diff --git a/nexus/db-model/src/schema_versions.rs b/nexus/db-model/src/schema_versions.rs index cc34a3581c..2e7226305a 100644 --- a/nexus/db-model/src/schema_versions.rs +++ b/nexus/db-model/src/schema_versions.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; /// /// This must be updated when you change the database schema. Refer to /// schema/crdb/README.adoc in the root of this repository for details. -pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(83, 0, 0); +pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(84, 0, 0); /// List of all past database schema versions, in *reverse* order /// @@ -29,6 +29,7 @@ static KNOWN_VERSIONS: Lazy> = Lazy::new(|| { // | leaving the first copy as an example for the next person. // v // KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"), + KnownVersion::new(84, "inv-dataset"), KnownVersion::new(83, "dataset-address-optional"), KnownVersion::new(82, "region-port"), KnownVersion::new(81, "add-nullable-filesystem-pool"), diff --git a/schema/crdb/dbinit.sql b/schema/crdb/dbinit.sql index ecef64d197..957de216f7 100644 --- a/schema/crdb/dbinit.sql +++ b/schema/crdb/dbinit.sql @@ -3206,7 +3206,6 @@ CREATE TABLE IF NOT EXISTS omicron.public.inv_dataset ( -- - Which collection this was -- - The sled reporting the disk -- - The name of this dataset - -- - The slot in which this disk was found PRIMARY KEY (inv_collection_id, sled_id, name) ); @@ -4171,7 +4170,7 @@ INSERT INTO omicron.public.db_metadata ( version, target_version ) VALUES - (TRUE, NOW(), NOW(), '83.0.0', NULL) + (TRUE, NOW(), NOW(), '84.0.0', NULL) ON CONFLICT DO NOTHING; COMMIT; diff --git a/schema/crdb/inv-dataset/up01.sql b/schema/crdb/inv-dataset/up01.sql new file mode 100644 index 0000000000..4504768c40 --- /dev/null +++ b/schema/crdb/inv-dataset/up01.sql @@ -0,0 +1,16 @@ +CREATE TABLE IF NOT EXISTS omicron.public.inv_dataset ( + inv_collection_id UUID NOT NULL, + sled_id UUID NOT NULL, + + id UUID, + + name TEXT NOT NULL, + available INT8 NOT NULL, + used INT8 NOT NULL, + quota INT8, + reservation INT8, + compression TEXT NOT NULL, + + PRIMARY KEY (inv_collection_id, sled_id, name) +); +