diff --git a/data/migrations/20200502193341_participant.js b/data/migrations/20200502193341_participant.js index 13c58d0..93a861e 100644 --- a/data/migrations/20200502193341_participant.js +++ b/data/migrations/20200502193341_participant.js @@ -3,14 +3,14 @@ exports.up = (knex) => { table.integer('account_id').unsigned(); table.uuid('meeting_id').unsigned(); table - .foreign('meeting_id') - .references('meeting.id') - .onDelete('cascade'); + .foreign('meeting_id') + .references('meeting.id') + .onDelete('cascade'); table - .foreign('account_id') - .references('account.id') - .onDelete('cascade'); - table.primary(['meeting_id','account_id']); + .foreign('account_id') + .references('account.id') + .onDelete('cascade'); + table.primary(['meeting_id', 'account_id']); table.time('earliest_time'); table.time('latest_time'); table.boolean('quorum'); diff --git a/data/migrations/20200502193352_possible_date.js b/data/migrations/20200502193352_possible_date.js index 32c426e..fc59151 100644 --- a/data/migrations/20200502193352_possible_date.js +++ b/data/migrations/20200502193352_possible_date.js @@ -1,10 +1,9 @@ exports.up = (knex) => { return knex.schema.createTable('possible_date', (table) => { table.increments('id').primary(); + table.uuid('meeting_id').unsigned().notNullable(); table - .uuid('meeting_id') - .unsigned() - .notNullable() + .foreign('meeting_id') .references('meeting.id') .onDelete('cascade'); table.date('possible_date').notNullable();