mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
parent
7956503a46
commit
fe91b5241e
478 changed files with 21226 additions and 19495 deletions
|
@ -1,18 +1,15 @@
|
|||
module.exports.up = (knex) =>
|
||||
knex.raw(`
|
||||
CREATE SEQUENCE next_id_seq;
|
||||
|
||||
CREATE FUNCTION next_id(OUT id BIGINT) AS $$
|
||||
DECLARE
|
||||
shard INT := 1;
|
||||
epoch BIGINT := 1567191600000;
|
||||
|
||||
sequence BIGINT;
|
||||
milliseconds BIGINT;
|
||||
BEGIN
|
||||
SELECT nextval('next_id_seq') % 1024 INTO sequence;
|
||||
SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 1000) INTO milliseconds;
|
||||
|
||||
id := (milliseconds - epoch) << 23;
|
||||
id := id | (shard << 10);
|
||||
id := id | (sequence);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports.up = (knex) =>
|
||||
knex.schema.createTable('project_membership', (table) => {
|
||||
knex.schema.createTable('project_manager', (table) => {
|
||||
/* Columns */
|
||||
|
||||
table.bigInteger('id').primary().defaultTo(knex.raw('next_id()'));
|
19
server/db/migrations/20180722001747_create_board_membership_table.js
Executable file
19
server/db/migrations/20180722001747_create_board_membership_table.js
Executable file
|
@ -0,0 +1,19 @@
|
|||
module.exports.up = (knex) =>
|
||||
knex.schema.createTable('board_membership', (table) => {
|
||||
/* Columns */
|
||||
|
||||
table.bigInteger('id').primary().defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.bigInteger('board_id').notNullable();
|
||||
table.bigInteger('user_id').notNullable();
|
||||
|
||||
table.timestamp('created_at', true);
|
||||
table.timestamp('updated_at', true);
|
||||
|
||||
/* Indexes */
|
||||
|
||||
table.unique(['board_id', 'user_id']);
|
||||
table.index('user_id');
|
||||
});
|
||||
|
||||
module.exports.down = (knex) => knex.schema.dropTable('board_membership');
|
|
@ -6,6 +6,7 @@ module.exports.up = (knex) =>
|
|||
|
||||
table.bigInteger('board_id').notNullable();
|
||||
table.bigInteger('list_id');
|
||||
table.bigInteger('creator_user_id').notNullable();
|
||||
table.bigInteger('cover_attachment_id');
|
||||
|
||||
table.specificType('position', 'double precision');
|
||||
|
|
|
@ -5,7 +5,7 @@ module.exports.up = (knex) =>
|
|||
table.bigInteger('id').primary().defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.bigInteger('card_id').notNullable();
|
||||
table.bigInteger('user_id').notNullable();
|
||||
table.bigInteger('creator_user_id').notNullable();
|
||||
|
||||
table.text('dirname').notNullable();
|
||||
table.text('filename').notNullable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue