[model] migrations setup
This commit is contained in:
15
server/migrations/20191025150506-notifications_index.js
Normal file
15
server/migrations/20191025150506-notifications_index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.addIndex('notifications', {
|
||||
unique: true,
|
||||
fields: ['action', 'type']
|
||||
}).catch(e => {})
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.removeIndex('notifications',
|
||||
['actions', 'type'])
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user