Change db structure to allow inviteless accounts
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user