我对sequelize和迁移是个新手。我想从另一个表中获取一个外键,但是我做错了,我不知道为什么。
有什么建议吗?
*module.exports = {
up: async (queryInterface, Sequelize) => {
return queryInterface.createTable('comments',{
topicid : {
type:Sequelize.INTEGER,
foreignKey : true
},
commentid : {
type : Sequelize.INTEGER,
primaryKey:true,
autoIncrement:true,
},
comment : {
type : Sequelize.STRING
}
})
},
down: async (queryInterface, Sequelize) => {
/**
* Add reverting commands here.
*
* Example:
* await queryInterface.dropTable('users');
*/
}
};*
转载请注明出处:http://www.jxbyjx.net/article/20230503/1050107.html