1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00
planka/server/db/migrations/20180722003614_create_card_table.js

29 lines
805 B
JavaScript
Raw Normal View History

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) => {
/* 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
table.bigInteger('board_id').notNullable();
table.bigInteger('list_id');
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
table.specificType('position', 'double precision');
table.text('name').notNullable();
table.text('description');
2022-06-20 18:27:39 +02:00
table.timestamp('due_date', true);
table.jsonb('timer');
2019-08-31 04:07:25 +05:00
table.timestamp('created_at', true);
table.timestamp('updated_at', true);
2019-08-31 04:07:25 +05:00
/* Indexes */
2019-08-31 04:07:25 +05:00
table.index('board_id');
2020-08-11 20:45:35 +05:00
table.index('list_id');
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');