This pull request addresses issues with the database migration for Discord settings in ApplicationSettings, ensuring that all required columns are added reliably even for databases with broken migration history. The changes include recreating the migration with a new timestamp, using raw SQL for robust column addition, and updating the changelog to reflect these fixes.
Database migration reliability improvements:
- Recreated the migration for Discord settings with a new timestamp (
20251109043000_AddDiscordSettingsToApplicationSettings) to ensure it runs on all databases, including those with previously broken migration history. - Migration uses raw SQL to conditionally add Discord-related columns to
ApplicationSettings, handling cases where columns may already exist or were manually added, and avoids transaction errors. - The
Downmethod in the migration cleanly removes all Discord-related columns, supporting proper rollback.
Documentation updates:
- Updated
CHANGELOG.mdto describe the migration fix and the new approach for automatic repair of broken databases, including details of added columns and resolved errors.
File maintenance:
- Renamed the previous migration file to prevent conflicts and ensure the new migration executes as intended.
Automated canary build