2020-05-02 19:06:34 +00:00
|
|
|
exports.up = (knex) => {
|
|
|
|
return knex.schema.createTable('participant', (table) => {
|
2020-05-04 16:47:05 +00:00
|
|
|
table.integer('account_id').unsigned();
|
|
|
|
table.uuid('meeting_id').unsigned();
|
2020-05-02 19:06:34 +00:00
|
|
|
table
|
2020-05-04 17:00:20 +00:00
|
|
|
.foreign('meeting_id')
|
|
|
|
.references('meeting.id')
|
|
|
|
.onDelete('cascade');
|
2020-05-02 19:06:34 +00:00
|
|
|
table
|
2020-05-04 17:00:20 +00:00
|
|
|
.foreign('account_id')
|
|
|
|
.references('account.id')
|
|
|
|
.onDelete('cascade');
|
|
|
|
table.primary(['meeting_id', 'account_id']);
|
2020-05-02 19:06:34 +00:00
|
|
|
table.boolean('quorum');
|
|
|
|
table.boolean('mandatory');
|
2020-08-26 11:20:54 +00:00
|
|
|
table.boolean('host').notNullable();
|
|
|
|
table.boolean('answered').notNullable();
|
2020-05-02 19:06:34 +00:00
|
|
|
table.timestamps(true, true);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.down = (knex) => {
|
|
|
|
return knex.schema.dropTable('participant');
|
|
|
|
};
|