2020-04-03 00:35:25 +05:00
|
|
|
module.exports.up = (knex) =>
|
|
|
|
knex.schema.createTable('task', (table) => {
|
2020-02-03 18:42:31 +05:00
|
|
|
/* Columns */
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-04-03 00:35:25 +05:00
|
|
|
table.bigInteger('id').primary().defaultTo(knex.raw('next_id()'));
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
table.bigInteger('card_id').notNullable();
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
table.text('name').notNullable();
|
|
|
|
table.boolean('is_completed').notNullable();
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
table.timestamp('created_at', true);
|
|
|
|
table.timestamp('updated_at', true);
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
/* Indexes */
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
table.index('card_id');
|
|
|
|
});
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-04-03 00:35:25 +05:00
|
|
|
module.exports.down = (knex) => knex.schema.dropTable('task');
|