Skip to content

fix: wrong default group priority in migration#133

Merged
SvenMokveldje merged 1 commit intodevelopfrom
fix/wrong-default-group-priority-in-migration
Mar 24, 2026
Merged

fix: wrong default group priority in migration#133
SvenMokveldje merged 1 commit intodevelopfrom
fix/wrong-default-group-priority-in-migration

Conversation

@SvenMokveldje
Copy link
Collaborator

It was set to HIGH instead of default.

Description

Related issues/external references

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation improvement
  • Style (Change that do not affect the functionality of the code)
  • CI/CD (Changes to the CI/CD configuration)
  • Refactoring (Changes that neither fixes a bug nor adds a feature)

It was set to HIGH instead of default.
Copilot AI review requested due to automatic review settings March 24, 2026 10:10
@SvenMokveldje SvenMokveldje merged commit 0997dc5 into develop Mar 24, 2026
1 check passed
@SvenMokveldje SvenMokveldje deleted the fix/wrong-default-group-priority-in-migration branch March 24, 2026 10:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 priority value inserted for all (user, shift_group) combinations.
  • Changes the constant selected inside the NOT EXISTS subquery (from SELECT 2 to SELECT 1).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 23 to 26
u.id as user_id,
sg.id as shift_group_id,
2 AS priority,
1 AS priority,
NOW(),
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants