2020-02-03 18:42:31 +05:00
|
|
|
module.exports.up = knex =>
|
|
|
|
knex.schema.createTable('card', table => {
|
|
|
|
/* Columns */
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +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('list_id').notNullable();
|
|
|
|
table.bigInteger('board_id').notNullable();
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
table.specificType('position', 'double precision').notNullable();
|
|
|
|
table.text('name').notNullable();
|
|
|
|
table.text('description');
|
|
|
|
table.timestamp('dueDate', true);
|
|
|
|
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-02-03 18:42:31 +05:00
|
|
|
table.index('list_id');
|
|
|
|
table.index('position');
|
|
|
|
});
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
module.exports.down = knex => knex.schema.dropTable('card');
|