Created
April 13, 2019 04:21
-
-
Save theptrk/8e92a45b1ebd49bf7dc44ffa9138e36b to your computer and use it in GitHub Desktop.
Run $ /node_modules/.bin/sequelize migration:generate --name 1m_user_to_dids
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = { | |
up: (queryInterface, Sequelize) => { | |
return queryInterface.addColumn( | |
'Dids', | |
'UserId', | |
{ | |
type: Sequelize.INTEGER, | |
references: { | |
model: 'Users', | |
key: "id" | |
}, | |
onDelete: 'cascade', | |
allowNull: false | |
}) | |
}, | |
down: (queryInterface, Sequelize) => { | |
return queryInterface.removeColumn('Dids', 'UserId'); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment