Added Event model and logging to Collection

This commit is contained in:
Jori Lallo
2017-10-09 23:27:34 -07:00
parent d44ef41c34
commit 7c3cfbc9da
3 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
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');
},
};