-
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
B 21934 int #14553
B 21934 int #14553
Changes from all commits
31fd371
a21714d
633df9d
0f3269c
667d8b4
a1e1fb0
336c02b
1d69b42
e5c2c40
4d5344f
2440a23
b756b98
341c8fa
9bfa6a2
36ed644
84afa63
464e4cf
87ab429
6b044c6
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,2 @@ | ||
ALTER TABLE entitlements | ||
ADD COLUMN IF NOT EXISTS admin_restricted_weight_location BOOLEAN; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE entitlements | ||
ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)), | ||
ALTER COLUMN admin_restricted_weight_location SET DEFAULT false, | ||
ALTER COLUMN admin_restricted_weight_location SET NOT NULL; | ||
Comment on lines
+1
to
+4
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. Hey there, so this ticket was missing an upstream (Minimal impact), but in the db it was decided that the boolean value is not needed if we have a not null See #14525 (comment) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE entitlements | ||
ADD column IF NOT EXISTS weight_restriction int; | ||
|
||
COMMENT ON COLUMN entitlements.weight_restriction IS 'The weight restricted on the move to a particular location'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai | |
proGearWeight := 2000 | ||
proGearWeightSpouse := 500 | ||
ordersType := internalmessages.OrdersTypePERMANENTCHANGEOFSTATION | ||
weightRestriction := 0 | ||
|
||
// Create default Entitlement | ||
entitlement := models.Entitlement{ | ||
|
@@ -59,6 +60,8 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai | |
ProGearWeightSpouse: proGearWeightSpouse, | ||
RequiredMedicalEquipmentWeight: rmeWeight, | ||
OrganizationalClothingAndIndividualEquipment: ocie, | ||
AdminRestrictedWeightLocation: setBoolPtr(cEntitlement.AdminRestrictedWeightLocation, false), | ||
WeightRestriction: &weightRestriction, | ||
Comment on lines
+63
to
+64
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. If weight restriction doesn't exist, this would probably be better off left as nil instead of set to 0 |
||
} | ||
// Set default calculated values | ||
entitlement.SetWeightAllotment(string(*grade), ordersType) | ||
|
@@ -73,4 +76,5 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai | |
} | ||
|
||
return entitlement | ||
|
||
} |
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.
Since this is the bool, ref'ing the other file at migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql with #14525 (comment)