gancio-upstream/server/migrations/20200129173454-user_email_index.js

13 lines
282 B
JavaScript

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addIndex('users', {
unique: true,
fields: ['email']
}).catch(e => {})
},
down: (queryInterface, Sequelize) => {
return queryInterface.removeIndex('users', ['email'])
}
}