summaryrefslogtreecommitdiffstats
path: root/src/db/migrations.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/migrations.rs')
-rw-r--r--src/db/migrations.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/db/migrations.rs b/src/db/migrations.rs
index cb01765..015610a 100644
--- a/src/db/migrations.rs
+++ b/src/db/migrations.rs
@@ -323,7 +323,12 @@ CREATE TABLE IF NOT EXISTS gc_run (
);
"#;
-pub static MIGRATIONS: &[Migration] = &[
+/// The migration list, in version order.
+///
+/// `db::migrate` walks it; nothing outside `db` asks for the list itself
+/// except a test that asserts it is ordered and complete. The table lives
+/// once, in `MIGRATIONS_ALL`, so the two aliases below cannot drift apart.
+static MIGRATIONS_ALL: &[Migration] = &[
Migration { version: 1, name: "core", sql: M_0001_CORE },
Migration { version: 2, name: "build", sql: M_0002_BUILD },
Migration { version: 3, name: "notices", sql: M_0003_NOTICES },
@@ -334,6 +339,12 @@ pub static MIGRATIONS: &[Migration] = &[
Migration { version: 8, name: "retention", sql: M_0008_RETENTION },
];
+#[cfg(feature = "test-support")]
+pub static MIGRATIONS: &[Migration] = MIGRATIONS_ALL;
+
+#[cfg(not(feature = "test-support"))]
+pub(crate) static MIGRATIONS: &[Migration] = MIGRATIONS_ALL;
+
pub(crate) const DEFAULT_SETTINGS: &[(&str, &str)] = &[
("max_concurrent_builds", "1"),
("build_timeout", "5400"),