[chore] added prettier
This commit is contained in:
@@ -1,43 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
up: function(queryInterface, Sequelize) {
|
||||
queryInterface.createTable('revisions', {
|
||||
id: {
|
||||
type: 'UUID',
|
||||
allowNull: false,
|
||||
primaryKey: true
|
||||
primaryKey: true,
|
||||
},
|
||||
title:
|
||||
{ type: 'CHARACTER VARYING',
|
||||
allowNull: false,
|
||||
title: {
|
||||
type: 'CHARACTER VARYING',
|
||||
allowNull: false,
|
||||
},
|
||||
text:
|
||||
{ type: 'TEXT',
|
||||
allowNull: true,
|
||||
text: {
|
||||
type: 'TEXT',
|
||||
allowNull: true,
|
||||
},
|
||||
html:
|
||||
{ type: 'TEXT',
|
||||
allowNull: true,
|
||||
html: {
|
||||
type: 'TEXT',
|
||||
allowNull: true,
|
||||
},
|
||||
preview:
|
||||
{ type: 'TEXT',
|
||||
allowNull: true,
|
||||
preview: {
|
||||
type: 'TEXT',
|
||||
allowNull: true,
|
||||
},
|
||||
createdAt:
|
||||
{ type: 'TIMESTAMP WITH TIME ZONE',
|
||||
allowNull: false,
|
||||
createdAt: {
|
||||
type: 'TIMESTAMP WITH TIME ZONE',
|
||||
allowNull: false,
|
||||
},
|
||||
updatedAt:
|
||||
{ type: 'TIMESTAMP WITH TIME ZONE',
|
||||
allowNull: false,
|
||||
updatedAt: {
|
||||
type: 'TIMESTAMP WITH TIME ZONE',
|
||||
allowNull: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'UUID',
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'users',
|
||||
}
|
||||
},
|
||||
},
|
||||
documentId: {
|
||||
type: 'UUID',
|
||||
@@ -45,36 +45,28 @@ module.exports = {
|
||||
references: {
|
||||
model: 'documents',
|
||||
onDelete: 'CASCADE',
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
queryInterface.addColumn(
|
||||
'documents',
|
||||
'lastModifiedById',
|
||||
{
|
||||
type: 'UUID',
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'users',
|
||||
}
|
||||
}
|
||||
);
|
||||
queryInterface.addColumn('documents', 'lastModifiedById', {
|
||||
type: 'UUID',
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'users',
|
||||
},
|
||||
});
|
||||
|
||||
queryInterface.addColumn(
|
||||
'documents',
|
||||
'revisionCount',
|
||||
{
|
||||
type: 'INTEGER',
|
||||
defaultValue: 0
|
||||
}
|
||||
);
|
||||
queryInterface.addColumn('documents', 'revisionCount', {
|
||||
type: 'INTEGER',
|
||||
defaultValue: 0,
|
||||
});
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
down: function(queryInterface, Sequelize) {
|
||||
queryInterface.dropTable('revisions');
|
||||
|
||||
queryInterface.removeColumn('documents', 'lastModifiedById');
|
||||
queryInterface.removeColumn('documents', 'revisionCount');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user