2020-04-03 00:35:25 +05:00
|
|
|
module.exports.up = (knex) =>
|
2022-06-20 18:27:39 +02:00
|
|
|
knex.schema.createTable('card', async (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('board_id').notNullable();
|
2020-08-04 01:32:46 +05:00
|
|
|
table.bigInteger('list_id');
|
2021-06-24 01:05:22 +05:00
|
|
|
table.bigInteger('creator_user_id').notNullable();
|
2020-04-23 03:02:53 +05:00
|
|
|
table.bigInteger('cover_attachment_id');
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-08-04 01:32:46 +05:00
|
|
|
table.specificType('position', 'double precision');
|
2020-02-03 18:42:31 +05:00
|
|
|
table.text('name').notNullable();
|
|
|
|
table.text('description');
|
2022-06-20 18:27:39 +02:00
|
|
|
table.timestamp('due_date', true);
|
2020-02-03 18:42:31 +05:00
|
|
|
table.jsonb('timer');
|
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-08-04 01:32:46 +05:00
|
|
|
table.index('board_id');
|
2020-08-11 20:45:35 +05:00
|
|
|
table.index('list_id');
|
2020-02-03 18:42:31 +05:00
|
|
|
table.index('position');
|
|
|
|
});
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-04-03 00:35:25 +05:00
|
|
|
module.exports.down = (knex) => knex.schema.dropTable('card');
|