fix: wrong default group priority in migration#133
Conversation
It was set to HIGH instead of default.
There was a problem hiding this comment.
Pull request overview
Updates the MySQL migration that initializes shift_group_priorities records, intended to correct the initial/default priority value assigned to user–shift group pairs.
Changes:
- Adjusts the seeded
priorityvalue inserted for all(user, shift_group)combinations. - Changes the constant selected inside the
NOT EXISTSsubquery (fromSELECT 2toSELECT 1).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| u.id as user_id, | ||
| sg.id as shift_group_id, | ||
| 2 AS priority, | ||
| 1 AS priority, | ||
| NOW(), |
There was a problem hiding this comment.
The migration now inserts priority = 1, but the application’s models.GroupPriority enum defines Default = 2 (and Swagger documents values 1/2/3). With the current Go model, inserting 1 initializes records to Low, not Default, and will make a freshly migrated MySQL DB behave differently than the code expects. Suggest keeping this at 2 (or, if the intended mapping is 0/1/2, update the Go enum + docs accordingly).
It was set to HIGH instead of default.
Description
Related issues/external references
Types of changes