Skip to content

Commit 4910000

Browse files
committed
schema migration
1 parent 393f64a commit 4910000

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

nexus/db-model/src/schema_versions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::collections::BTreeMap;
1717
///
1818
/// This must be updated when you change the database schema. Refer to
1919
/// schema/crdb/README.adoc in the root of this repository for details.
20-
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(114, 0, 0);
20+
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(115, 0, 0);
2121

2222
/// List of all past database schema versions, in *reverse* order
2323
///
@@ -29,6 +29,7 @@ static KNOWN_VERSIONS: Lazy<Vec<KnownVersion>> = Lazy::new(|| {
2929
// | leaving the first copy as an example for the next person.
3030
// v
3131
// KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"),
32+
KnownVersion::new(115, "inv-omicron-physical-disks-generation"),
3233
KnownVersion::new(114, "crucible-ref-count-records"),
3334
KnownVersion::new(113, "add-tx-eq"),
3435
KnownVersion::new(112, "blueprint-dataset"),

schema/crdb/dbinit.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4687,7 +4687,7 @@ INSERT INTO omicron.public.db_metadata (
46874687
version,
46884688
target_version
46894689
) VALUES
4690-
(TRUE, NOW(), NOW(), '114.0.0', NULL)
4690+
(TRUE, NOW(), NOW(), '115.0.0', NULL)
46914691
ON CONFLICT DO NOTHING;
46924692

46934693
COMMIT;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE omicron.public.inv_sled_agent
2+
ADD COLUMN IF NOT EXISTS omicrion_physical_disks_generation INT8
3+
NOT NULL DEFAULT 0;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE omicron.public.inv_sled_agent
2+
ALTER COLUMN omicron_physical_disks_generation DROP DEFAULT;

0 commit comments

Comments
 (0)