Add CRUD operations for participant

This commit is contained in:
2020-05-04 18:47:05 +02:00
parent f48244292c
commit 6ce64b5e95
5 changed files with 151 additions and 15 deletions

View File

@@ -1,18 +1,16 @@
exports.up = (knex) => {
return knex.schema.createTable('participant', (table) => {
table.increments('id').primary();
table.integer('account_id').unsigned();
table.uuid('meeting_id').unsigned();
table
.integer('account_id')
.unsigned()
.notNullable()
.references('account.id')
.onDelete('cascade');
.foreign('meeting_id')
.references('meeting.id')
.onDelete('cascade');
table
.uuid('meeting_id')
.unsigned()
.notNullable()
.references('meeting.id')
.onDelete('cascade');
.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');

View File

@@ -1,11 +1,12 @@
exports.up = (knex) => {
return knex.schema.createTable('availibility', (table) => {
table.increments('id').primary();
table.uuid('meeting_id').unsigned();
table.integer('account_id').unsigned();
table
.integer('participant_id')
.unsigned()
.notNullable()
.references('participant.id')
.foreign(['account_id', 'meeting_id'])
.references(['account_id', 'meeting_id'])
.on('participant')
.onDelete('cascade');
table
.integer('possible_date_id')