-
Notifications
You must be signed in to change notification settings - Fork 35
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
Main b 18911 gun safe backend #12557
Changes from all commits
d9c2690
82e0486
ef33074
8b19ba8
2e071ea
aa92b77
808e25f
138693e
a53c5aa
200690c
1ca9b99
80e9b9d
8921e5f
afeaa6c
d297b72
1e64b65
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,7 @@ | ||
-- Adds new column to entitlements table | ||
-- allows customer to move a gun safe with their move. | ||
ALTER TABLE entitlements | ||
ADD COLUMN IF NOT EXISTS gun_safe BOOLEAN DEFAULT FALSE; | ||
|
||
-- Comments on new column | ||
COMMENT ON COLUMN entitlements.gun_safe IS 'True if customer is entitled to move a gun safe up to 500 lbs without it being charged against their authorized weight allowance.'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- COALESCE makes sure that any currently NULL gun_safe values are converted to false before setting to NOT NULL. | ||
ALTER TABLE entitlements | ||
ALTER COLUMN gun_safe TYPE boolean USING (COALESCE(gun_safe, false)), | ||
ALTER COLUMN gun_safe SET DEFAULT false, | ||
ALTER COLUMN gun_safe SET NOT NULL; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is taken care of in the above migration file?
ALTER COLUMN gun_safe SET DEFAULT false,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in my original migration that added the gun_safe column, it could be either T, F, or null, but after finding that null would error out in some cases, I added this migration to edit the table so that it's only true or false, since that also makes sense logically anyway. Now it defaults to false, and is only set to true if the customer/office user flags that a gun safe is allowed.