gancio-upstream/server/migrations/20190605142434-create-comment.js
2019-06-07 17:02:33 +02:00

38 lines
No EOL
808 B
JavaScript

'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('comments', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
eventId: {
type: Sequelize.INTEGER,
references: {
model: 'events',
key: 'id'
}
},
activitypub_id: {
type: Sequelize.BIGINT,
index: true,
},
data: {
type: Sequelize.JSON
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('comments');
}
};