diff options
Diffstat (limited to 'src/db/migrations.rs')
| -rw-r--r-- | src/db/migrations.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/db/migrations.rs b/src/db/migrations.rs index 4c4774e..0a1ca27 100644 --- a/src/db/migrations.rs +++ b/src/db/migrations.rs @@ -20,7 +20,7 @@ CREATE TABLE settings ( value TEXT NOT NULL ); --- Append-only audit log (I10). Enforced by trigger below. +-- Append-only audit log. Enforced by trigger below. CREATE TABLE audit ( id INTEGER PRIMARY KEY, at TEXT NOT NULL, @@ -41,7 +41,7 @@ CREATE TABLE pkgbase ( aur_head TEXT, -- live mirror tip current_accepted_release_id INTEGER, -- the single pointer everything reads state TEXT NOT NULL DEFAULT 'tracked', - unpinable INTEGER NOT NULL DEFAULT 0, -- §16 pkgver() that ignores pins + unpinable INTEGER NOT NULL DEFAULT 0, -- pkgver() that ignores pins created_at TEXT NOT NULL ); @@ -55,13 +55,13 @@ CREATE TABLE subscription ( next_check_at TEXT, last_checked_at TEXT, last_error TEXT, - poll_interval_secs INTEGER, -- per-source override (§19) + poll_interval_secs INTEGER, -- per-source override created_at TEXT NOT NULL, UNIQUE (repo_id, pkgbase) ); CREATE INDEX subscription_due ON subscription (state, next_check_at); --- An immutable pin of the AUR git repo for a pkgbase (§5.1a). +-- An immutable pin of the AUR git repo for a pkgbase. CREATE TABLE snapshot ( id INTEGER PRIMARY KEY, pkgbase_id INTEGER NOT NULL REFERENCES pkgbase(id), @@ -73,7 +73,7 @@ CREATE TABLE snapshot ( UNIQUE (pkgbase_id, aur_commit) ); --- Fingerprint of the accepted dep set a build ran against (§10.1). +-- Fingerprint of the accepted dep set a build ran against. CREATE TABLE world_snapshot ( id INTEGER PRIMARY KEY, hash TEXT NOT NULL UNIQUE, @@ -119,11 +119,11 @@ CREATE TABLE candidate ( CREATE INDEX candidate_by_pkgbase ON candidate (pkgbase_id, state); CREATE INDEX candidate_pending_age ON candidate (state, detected_at); --- I7: at most one open review per pkgbase, as a database guarantee. +-- At most one open review per pkgbase, as a database guarantee. CREATE UNIQUE INDEX one_open_review_per_pkgbase ON candidate (pkgbase_id) WHERE state = 'pending_review'; --- The immutable decision record (§7.2). +-- The immutable decision record. CREATE TABLE approval ( id INTEGER PRIMARY KEY, candidate_id INTEGER NOT NULL UNIQUE REFERENCES candidate(id), @@ -157,7 +157,7 @@ CREATE TABLE release ( ); CREATE INDEX release_by_pkgbase ON release (pkgbase_id, state); --- `package` is the unit of the index and dependency resolution (§3). +-- `package` is the unit of the index and dependency resolution. CREATE TABLE package ( id INTEGER PRIMARY KEY, repo_id INTEGER NOT NULL REFERENCES repo(id), @@ -173,7 +173,7 @@ CREATE INDEX package_by_name ON package (repo_id, name, state); const M_0002_BUILD: &str = r#" CREATE TABLE build ( - id TEXT PRIMARY KEY, -- deterministic intent hash (§8.2) + id TEXT PRIMARY KEY, -- deterministic intent hash pkgbase_id INTEGER NOT NULL REFERENCES pkgbase(id), candidate_id INTEGER REFERENCES candidate(id), release_id INTEGER REFERENCES release(id), @@ -196,7 +196,7 @@ CREATE TABLE build ( CREATE INDEX build_queued ON build (state, priority DESC, created_at); CREATE INDEX build_lease ON build (state, lease_expires_at); --- Step-level checkpoints: the mechanism behind I5. +-- Step-level checkpoints: what a resume reads. CREATE TABLE build_step ( build_id TEXT NOT NULL REFERENCES build(id), step TEXT NOT NULL, @@ -211,7 +211,7 @@ CREATE TABLE build_step ( "#; const M_0003_NOTICES: &str = r#" --- "something changed but nothing is publishable" (§5.2, I11). +-- "something changed but nothing is publishable". CREATE TABLE notice ( id INTEGER PRIMARY KEY, pkgbase_id INTEGER NOT NULL REFERENCES pkgbase(id), @@ -240,7 +240,7 @@ CREATE TABLE vcs_cache ( fetched_at TEXT NOT NULL ); --- Derived, read-only: "approving this marks N packages stale" (§10.5). +-- Derived, read-only: "approving this marks N packages stale". -- Nothing consumes it automatically; it is a read-time aid only. CREATE TABLE dep_edge ( from_pkgbase TEXT NOT NULL, @@ -253,7 +253,7 @@ CREATE TABLE dep_edge ( "#; const M_0004_TRIGGERS: &str = r#" --- I10: the audit log is append-only. +-- The audit log is append-only. CREATE TRIGGER audit_no_update BEFORE UPDATE ON audit BEGIN @@ -308,7 +308,7 @@ ALTER TABLE artifact ADD COLUMN purged_at TEXT; -- Set when a release's files have been evicted; NULL means the bytes are held. ALTER TABLE release ADD COLUMN purged_at TEXT; --- Staging is disposable (§8.2), but "disposable" needs a definition: a dir is +-- Staging is disposable, but "disposable" needs a definition: a dir is -- swept when its build is terminal or unknown and the dir is older than the -- grace period. Recording the sweep keeps a crashed-then-swept build auditable. CREATE TABLE IF NOT EXISTS gc_run ( |
