mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
feat: Persist closed state per card
This commit is contained in:
parent
69c75a03b1
commit
709a0d1758
19 changed files with 163 additions and 71 deletions
|
@ -0,0 +1,28 @@
|
|||
/*!
|
||||
* Copyright (c) 2024 PLANKA Software GmbH
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('card', (table) => {
|
||||
/* Columns */
|
||||
|
||||
table.boolean('is_closed').notNullable().default(false);
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
UPDATE card
|
||||
SET is_closed = TRUE
|
||||
FROM list
|
||||
WHERE card.list_id = list.id AND list.type = 'closed';
|
||||
`);
|
||||
|
||||
return knex.schema.alterTable('card', (table) => {
|
||||
table.boolean('is_closed').notNullable().alter();
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = (knex) =>
|
||||
knex.schema.table('card', (table) => {
|
||||
table.dropColumn('is_closed');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue