Hello Guys,
I am trying to create multi reference table between 2 sub tables, however I am running into an error. Need your help in trying to understand the issue.
Project is on NodeJS + MS SQL Server.
I have these 2 sub tables, instBuilding & instCourse as per images.
I created a multi reference table ‘rooms’
While applying DB Changes i am getting error:
exports.up = function(knex) {
return knex.schema
.createTable('dbo.institute_instBuilding_rooms', async function (table) {
table.integer('instBuilding_id').unsigned();
table.foreign('instBuilding_id').references('buildingID').inTable('dbo.dbo.institute_instBuilding').onUpdate('CASCADE').onDelete('CASCADE');
table.integer('instCourseID').unsigned();
table.foreign('instCourseID').references('instCourseID').inTable('dbo.dbo.institute_instCourse');
})
};
exports.down = function(knex) {
return knex.schema
.dropTable('dbo.institute_instBuilding_rooms')
};