backend/data/migrations/20200502193443_availibility.js

30 lines
823 B
JavaScript

exports.up = (knex) => {
return knex.schema.createTable('availibility', (table) => {
table.increments('id').primary();
// Reference to participant composite primary key
table.uuid('meeting_id').unsigned();
table.integer('account_id').unsigned();
table
.foreign(['account_id', 'meeting_id'])
.references(['account_id', 'meeting_id'])
.on('participant')
.onDelete('cascade');
table.integer('possible_date_id');
table
.foreign('possible_date_id')
.references('possible_date.id')
.onDelete('cascade');
table.boolean('preference').notNullable();
table.time('start_time').notNullable();
table.time('end_time').notNullable();
table.string('timezone').notNullable();
table.timestamps(true, true);
});
};
exports.down = (knex) => {
return knex.schema.dropTable('availibility');
};