mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
41 lines
905 B
JavaScript
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')
|
|
}
|
|
}
|