gancio-upstream/server/migrations/20191025143411-comments.js
2019-10-28 17:33:20 +01:00

41 lines
905 B
JavaScript

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