gancio-upstream/server/migrations/20191025143411-comments.js

42 lines
905 B
JavaScript
Raw Permalink Normal View History

2019-10-28 17:33:20 +01:00
'use strict'
2019-10-25 18:43:49 +02:00
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('comments',
2019-10-28 17:33:20 +01:00
{
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true
2019-10-25 18:43:49 +02:00
},
2019-10-28 17:33:20 +01:00
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
}
})
2019-10-25 18:43:49 +02:00
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('comments')
}
2019-10-28 17:33:20 +01:00
}