27 lines
671 B
JavaScript
27 lines
671 B
JavaScript
|
exports.up = (knex) => {
|
||
|
return knex.schema.createTable('availibility', (table) => {
|
||
|
table.increments('id').primary();
|
||
|
table
|
||
|
.integer('participant_id')
|
||
|
.unsigned()
|
||
|
.notNullable()
|
||
|
.references('participant.id')
|
||
|
.onDelete('cascade');
|
||
|
table
|
||
|
.integer('possible_date_id')
|
||
|
.unsigned()
|
||
|
.notNullable()
|
||
|
.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');
|
||
|
};
|