- I created a multiref table using the ui (right click, New Multi Reference)
- This worked fine in my local dev environment (docker)
- When switching target to the live database (digital ocean managed db) and I try to apply the change, I get the following error:
This is the knex code:
exports.up = function(knex) {
return knex.schema
.createTable('product_linked_courses', async function (table) {
table.integer('product_id').unsigned();
table.foreign('product_id').references('id').inTable('products').onUpdate('CASCADE').onDelete('CASCADE');
table.integer('course_id').unsigned();
table.foreign('course_id').references('id').inTable('courses').onUpdate('CASCADE').onDelete('CASCADE');
})
};
exports.down = function(knex) {
return knex.schema
.dropTable('product_linked_courses')
};
If I look at knex code from an earlier made table (not multiref) it has table.increments('id')
which I guess is the thing that’s missing?
Community Page
Last updated:
Last updated: