OXYGENHUB
◆ v0.9.11 oxygenhub / crates / hub / migrations-pg / 0093_card_archive.sql
602 B · SQL · last changed Board cards can be archived, by hand or by age (refs #293) 10 days ago source blame history raw
1
-- Archived board cards (oxygenhub#293): off the board, kept, found with
2
-- the board's archive view and restorable. NULL while on the board.
3
ALTER TABLE project_cards ADD COLUMN archived_ms BIGINT;
4
-- When a card joined its column, so a column's cards can be archived some
5
-- days after they reached it (Done after 14 days).
6
ALTER TABLE project_cards ADD COLUMN moved_ms BIGINT NOT NULL DEFAULT 0;
7
UPDATE project_cards SET moved_ms = created_ms;
8
-- A column whose cards are archived this many days after they joined it;
9
-- NULL never.
10
ALTER TABLE project_columns ADD COLUMN archive_after_days BIGINT;