I'm new to the sequelize and migrations. I want to take a foreign key from another table but I'm doing it wrong and I don't know why.
Any suggestions, please?
*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');
*/
}
};*