Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Run $ /node_modules/.bin/sequelize migration:generate --name 1m_user_to_dids
'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
You can’t perform that action at this time.