OXYGENHUB
◆ v0.9.24 oxygenhub / crates / hub / migrations / 0100_board_iterations.sql
810 B · SQL · last changed Iterations on project boards: a named span of days with a burn-up of cards done; closing one archives its Done column's cards under it, its page lists them (closes #343) 9 days ago source blame history raw
046e3352 Andy McCall ↶ 1
-- Iterations on project boards (oxygenhub#343): a named span of days. A
2
-- board has at most one open at a time; closing it archives the cards in
3
-- its Done column under it, so the board shows the current iteration and
4
-- each past one keeps its cards and its burn-up.
5
CREATE TABLE project_iterations (
6
    id         INTEGER PRIMARY KEY,
7
    project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
8
    name       TEXT NOT NULL,
9
    start_ms   INTEGER NOT NULL,
10
    end_ms     INTEGER NOT NULL,
11
    closed_ms  INTEGER
12
);
13
CREATE INDEX project_iterations_by_project ON project_iterations (project_id, start_ms);
14
-- The iteration a card was archived under when that iteration closed.
15
ALTER TABLE project_cards ADD COLUMN iteration_id INTEGER REFERENCES project_iterations(id) ON DELETE SET NULL;