Skip to content

Commit

Permalink
Use CREATE OR REPLACE VIEW, bump schema version
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph committed Jan 31, 2024
1 parent eaf76f9 commit f0dda10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nexus/db-model/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use omicron_common::api::external::SemverVersion;
///
/// This should be updated whenever the schema is changed. For more details,
/// refer to: schema/crdb/README.adoc
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(31, 0, 0);
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(32, 0, 0);

table! {
disk (id) {
Expand Down
3 changes: 2 additions & 1 deletion schema/crdb/31.0.0/up.sql → schema/crdb/32.0.0/up.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ALTER VIEW omicron.public.silo_utilization
CREATE OR REPLACE VIEW omicron.public.silo_utilization
AS SELECT
c.id AS silo_id,
s.name AS silo_name,
-- This is the added column
s.discoverable as silo_discoverable,
c.cpus_provisioned AS cpus_provisioned,
c.ram_provisioned AS memory_provisioned,
Expand Down
2 changes: 1 addition & 1 deletion schema/crdb/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3419,7 +3419,7 @@ INSERT INTO omicron.public.db_metadata (
version,
target_version
) VALUES
( TRUE, NOW(), NOW(), '31.0.0', NULL)
( TRUE, NOW(), NOW(), '32.0.0', NULL)
ON CONFLICT DO NOTHING;

COMMIT;

0 comments on commit f0dda10

Please sign in to comment.