OXYGENHUB
◆ v0.9.0 oxygenhub / crates / hub / migrations / 0040_advanced.sql
607 B · SQL · last changed Advanced settings: transfer, archive, delete, wiki placeholder 1 month ago source blame history raw
1
-- Advanced settings (hub spec §6, #108): a repository can be archived
2
-- (read-only, with a reason) and transferred to another owner; the old
3
-- name redirects on the web and still resolves for oxy remotes.
4
ALTER TABLE repositories ADD COLUMN archived INTEGER NOT NULL DEFAULT 0;
5
ALTER TABLE repositories ADD COLUMN archived_reason TEXT NOT NULL DEFAULT '';
6
CREATE TABLE repo_redirects (
7
    old_owner   TEXT NOT NULL,
8
    old_name    TEXT NOT NULL,
9
    repo_id     INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
10
    moved_ms    INTEGER NOT NULL,
11
    PRIMARY KEY (old_owner, old_name)
12
);