2019-11-05 18:01:42 +05:00
|
|
|
module.exports.up = (knex) => knex.schema.createTable('list', (table) => {
|
|
|
|
/* Columns */
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2019-11-05 18:01:42 +05:00
|
|
|
table
|
|
|
|
.bigInteger('id')
|
|
|
|
.primary()
|
|
|
|
.defaultTo(knex.raw('next_id()'));
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2019-11-05 18:01:42 +05:00
|
|
|
table.bigInteger('board_id').notNullable();
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2019-11-05 18:01:42 +05:00
|
|
|
table.specificType('position', 'double precision').notNullable();
|
|
|
|
table.text('name').notNullable();
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2019-11-05 18:01:42 +05:00
|
|
|
table.timestamp('created_at', true);
|
|
|
|
table.timestamp('updated_at', true);
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2019-11-05 18:01:42 +05:00
|
|
|
/* Indexes */
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2019-11-05 18:01:42 +05:00
|
|
|
table.index('board_id');
|
|
|
|
table.index('position');
|
|
|
|
});
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2019-11-05 18:01:42 +05:00
|
|
|
module.exports.down = (knex) => knex.schema.dropTable('list');
|