Change db structure to allow inviteless accounts

This commit is contained in:
2020-08-28 13:10:15 +02:00
parent 38f3c06d51
commit 9cdf4eedd2
4 changed files with 19 additions and 19 deletions

View File

@@ -1,16 +1,9 @@
exports.up = (knex) => {
return knex.schema.createTable('participant', (table) => {
table.uuid('id').primary();
table.integer('account_id').unsigned();
table.uuid('meeting_id').unsigned();
table
.foreign('meeting_id')
.references('meeting.id')
.onDelete('cascade');
table
.foreign('account_id')
.references('account.id')
.onDelete('cascade');
table.primary(['meeting_id', 'account_id']);
table.string('email');
table.uuid('meeting_id').unsigned().notNullable();
table.boolean('quorum');
table.boolean('mandatory');
table.boolean('host').notNullable();

View File

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