parent
8c0c5d08fd
commit
8bc226eb4c
1 changed files with 19 additions and 0 deletions
19
server/migrations/20200129173454-user_email_index.js
Normal file
19
server/migrations/20200129173454-user_email_index.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.addIndex('users', {
|
||||
unique: true,
|
||||
fields: ['email']
|
||||
}).catch(e => {})
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add reverting commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.dropTable('users');
|
||||
*/
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue