diff options
| author | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
| commit | 3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 (patch) | |
| tree | 7cc7169181b4bdd73fd8817f8c1d7cce6e6998a8 /src/db/migrations.rs | |
| parent | 9dc9087d89891c6e5ef7e5dc084dd13c8611843e (diff) | |
| download | aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.tar.gz aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.zip | |
rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off
rustfmt.toml fixes the shape the tree is written in (120 columns, small
items kept on one line) and one canonical pass makes it the truth.
[lints.clippy] names the idiom lints worth enforcing and leaves out the
two that would add doc-comment boilerplate rather than remove it. The
tree pays them off here: write!/writeln! instead of push_str(&format!()),
let-else instead of match-on-Option, borrows where a thread entry point
only reads what it owns, no `&self` on a Copy state and no `self` nobody
reads.
ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and
value are now emitted by the same call instead of three.
Diffstat (limited to 'src/db/migrations.rs')
| -rw-r--r-- | src/db/migrations.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/db/migrations.rs b/src/db/migrations.rs index 7adc69c..2e552f2 100644 --- a/src/db/migrations.rs +++ b/src/db/migrations.rs @@ -5,7 +5,7 @@ pub struct Migration { pub sql: &'static str, } -const M_0001_CORE: &str = r#" +const M_0001_CORE: &str = r" -- The single repo we publish. Exactly one row. CREATE TABLE repo ( id INTEGER PRIMARY KEY, @@ -170,9 +170,9 @@ CREATE TABLE package ( state TEXT NOT NULL DEFAULT 'in_index' -- in_index | removed ); CREATE INDEX package_by_name ON package (repo_id, name, state); -"#; +"; -const M_0002_BUILD: &str = r#" +const M_0002_BUILD: &str = r" CREATE TABLE build ( id TEXT PRIMARY KEY, -- deterministic intent hash pkgbase_id INTEGER NOT NULL REFERENCES pkgbase(id), @@ -209,7 +209,7 @@ CREATE TABLE build_step ( finished_at TEXT, PRIMARY KEY (build_id, step) ); -"#; +"; const M_0003_NOTICES: &str = r#" -- "something changed but nothing is publishable". @@ -253,7 +253,7 @@ CREATE TABLE dep_edge ( ); "#; -const M_0004_TRIGGERS: &str = r#" +const M_0004_TRIGGERS: &str = r" -- The audit log is append-only. CREATE TRIGGER audit_no_update BEFORE UPDATE ON audit @@ -266,14 +266,14 @@ BEFORE DELETE ON audit BEGIN SELECT RAISE(ABORT, 'audit log is append-only: deletes are forbidden'); END; -"#; +"; -const M_0005_ARTIFACT_BUILD: &str = r#" +const M_0005_ARTIFACT_BUILD: &str = r" ALTER TABLE artifact ADD COLUMN build_id TEXT; CREATE INDEX artifact_by_build ON artifact (build_id); -"#; +"; -const M_0006_APPROVAL_IMMUTABLE: &str = r#" +const M_0006_APPROVAL_IMMUTABLE: &str = r" CREATE TRIGGER approval_no_update BEFORE UPDATE ON approval BEGIN @@ -285,9 +285,9 @@ BEFORE DELETE ON approval BEGIN SELECT RAISE(ABORT, 'approval records are immutable'); END; -"#; +"; -const M_0007_STAGE_B_CACHE: &str = r#" +const M_0007_STAGE_B_CACHE: &str = r" CREATE TABLE stage_b_cache ( pkgbase_id INTEGER NOT NULL REFERENCES pkgbase(id), recipe_hash TEXT NOT NULL, @@ -301,7 +301,7 @@ CREATE TABLE stage_b_cache ( ); CREATE INDEX stage_b_cache_by_pkgbase ON stage_b_cache (pkgbase_id, resolved_at); -"#; +"; const M_0008_RETENTION: &str = r#" ALTER TABLE artifact ADD COLUMN purged_at TEXT; |
