不要怂,就是干,撸起袖子干!

Commit 07ce68a4 by Nick

Add example about foreign key

1 parent ffc59576
Showing with 10 additions and 0 deletions
......@@ -106,6 +106,16 @@ queryInterface.createTable(
type: Sequelize.BOOLEAN,
defaultValue: false,
allowNull: false
},
//foreign key usage
attr4: {
type: Sequelize.INTEGER,
references: {
model: 'another_table_name',
key: 'id'
},
onUpdate: 'cascade',
onDelete: 'cascade'
}
},
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!