internal/store/migrations/0056_mr_labels.up.sql

28e72be7ab6bc96868893853fd8d210c3656960f
gitbay/internal/store/migrations/0056_mr_labels.up.sql

12 lines · 622 bytes

 1-- Labels on merge requests, carried the same way issues carry them
 2-- (#231). The label rows themselves are shared: repo or org scoped.
 3--
 4-- labels now has two child tables, issue_labels and mr_labels: a future
 5-- rebuild of labels must carry both. With foreign keys on, rebuilding a
 6-- parent table drops its children's rows, which is what the first-line
 7-- "-- foreign_keys: off" directive in 0052 is for.
 8CREATE TABLE mr_labels (
 9    mr_id    INTEGER NOT NULL REFERENCES merge_requests(id) ON DELETE CASCADE,
10    label_id INTEGER NOT NULL REFERENCES labels(id) ON DELETE CASCADE,
11    PRIMARY KEY (mr_id, label_id)
12);
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form