-
Notifications
You must be signed in to change notification settings - Fork 45
nexus: update switch_port_settings_route_config
schema
#8587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE omicron.public.switch_port_settings_route_config ADD COLUMN IF NOT EXISTS rib_priority INT2; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SET LOCAL disallow_full_table_scans = off; | ||
UPDATE omicron.public.switch_port_settings_route_config | ||
SET rib_priority = | ||
CASE | ||
WHEN local_pref > 255 THEN 255 | ||
WHEN local_pref < 0 THEN 0 | ||
ELSE local_pref::INT2 | ||
END; | ||
Comment on lines
+2
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I check for the existence of the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests aren't super helpful with migration steps that change data instead of structure; in general they run against an empty database, so any We do have a spot where you can check migrations that affect data, though; I just left a comment on another PR with details. It's probably straightforward to add a similar tests here - |
||
SET LOCAL disallow_full_table_scans = on; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you need to turn this back on; each step of the migration is run within its own transaction. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE omicron.public.switch_port_settings_route_config DROP COLUMN IF EXISTS local_pref; |
Uh oh!
There was an error while loading. Please reload this page.