-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[scd/crdb] Add columns ovn and past_ovns to scd_operations table; Bum…
…p schema_version to v3.2.0
- Loading branch information
Showing
10 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ALTER TABLE scd_operations | ||
DROP IF EXISTS ovn, | ||
DROP IF EXISTS past_ovns; | ||
|
||
UPDATE schema_versions | ||
SET schema_version = 'v3.1.0' | ||
WHERE onerow_enforcer = TRUE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ALTER TABLE scd_operations | ||
ADD COLUMN IF NOT EXISTS ovn STRING | ||
CHECK (ovn != ''), -- ovn must be NULL if unspecified, not an empty string | ||
ADD COLUMN IF NOT EXISTS past_ovns STRING[] NOT NULL | ||
DEFAULT ARRAY []::STRING[] | ||
CHECK ( | ||
array_position(past_ovns, NULL) IS NULL AND | ||
array_position(past_ovns, '') IS NULL AND ( | ||
ovn IS NULL OR | ||
array_position(past_ovns, ovn) IS NULL | ||
) -- current ovn, if specified, must not be part of the past_ovns | ||
); -- past_ovns must not contain NULL elements nor empty strings | ||
|
||
UPDATE schema_versions | ||
SET schema_version = 'v3.2.0' | ||
WHERE onerow_enforcer = TRUE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
deploy/infrastructure/dependencies/terraform-commons-dss/default_latest.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
locals { | ||
rid_db_schema = var.desired_rid_db_version == "latest" ? "4.0.0" : var.desired_rid_db_version | ||
scd_db_schema = var.desired_scd_db_version == "latest" ? "3.1.0" : var.desired_scd_db_version | ||
scd_db_schema = var.desired_scd_db_version == "latest" ? "3.2.0" : var.desired_scd_db_version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters