backend/data/migrations/20200502193443_availability.js

24 lines
668 B
JavaScript

exports.up = (knex) => {
return knex.schema.createTable('availability', (table) => {
table.increments('id').primary();
table.uuid('participant_id').notNullable();
table
.foreign('participant_id')
.references('participant.id')
.onDelete('cascade');
table.integer('possible_date_id').notNullable();
table
.foreign('possible_date_id')
.references('possible_date.id')
.onDelete('cascade');
table.boolean('preference').notNullable();
table.datetime('start_time').notNullable();
table.datetime('end_time').notNullable();
table.timestamps(true, true);
});
};
exports.down = (knex) => {
return knex.schema.dropTable('availability');
};