Change fk constraint in possible_date migration

This commit is contained in:
rui hildt 2020-05-04 19:00:20 +02:00
parent 6ce64b5e95
commit b7b7dbbc73
2 changed files with 9 additions and 10 deletions

View File

@ -1,10 +1,9 @@
exports.up = (knex) => { exports.up = (knex) => {
return knex.schema.createTable('possible_date', (table) => { return knex.schema.createTable('possible_date', (table) => {
table.increments('id').primary(); table.increments('id').primary();
table.uuid('meeting_id').unsigned().notNullable();
table table
.uuid('meeting_id') .foreign('meeting_id')
.unsigned()
.notNullable()
.references('meeting.id') .references('meeting.id')
.onDelete('cascade'); .onDelete('cascade');
table.date('possible_date').notNullable(); table.date('possible_date').notNullable();