This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/migrations/20171010042938-add-event.js
2017-10-09 23:27:34 -07:00

53 lines
1.0 KiB
JavaScript

module.exports = {
up: function(queryInterface, Sequelize) {
queryInterface.createTable('events', {
id: {
type: Sequelize.UUID,
allowNull: false,
primaryKey: true,
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
data: {
type: Sequelize.JSONB,
allowNull: false,
},
userId: {
type: Sequelize.UUID,
allowNull: true,
references: {
model: 'users',
},
},
collectionId: {
type: Sequelize.UUID,
allowNull: true,
references: {
model: 'collections',
},
},
teamId: {
type: Sequelize.UUID,
allowNull: true,
references: {
model: 'teams',
},
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
},
});
},
down: function(queryInterface, Sequelize) {
queryInterface.dropTable('events');
},
};