Fix migration file naming mismatch and add validation tooling - #169
Merged
Conversation
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issues with database migration for intra_notifications_type
Fix migration file naming mismatch for intra_notifications table
Nov 24, 2025
Collaborator
|
@copilot Kannst du auch die anderen Dateien nach ähnlichen Fehlern oder Problemen durchsuchen und diese präventiv beheben? |
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Contributor
Author
Ich habe eine umfassende Analyse aller 58 Migrationsdateien durchgeführt. Gute Nachricht: Keine kritischen Probleme gefunden! ✅ Alle CREATE (23) und ALTER (9) Migrationen sind korrekt benannt. Der ursprüngliche Präventive Maßnahmen implementiert:
Diese Tools helfen, zukünftige Naming-Probleme zu vermeiden. Commit: 4982429 |
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Copilot
AI
changed the title
Fix migration file naming mismatch for intra_notifications table
Fix migration file naming mismatch and add validation tooling
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration
alter_intra_notifications_type_04112025.phpfailed because the filename implied a non-existent tableintra_notifications_type, while the SQL altered the actualintra_notificationstable.The migration system extracts table names from filenames via regex
(create|alter)_(.+?)_\d{8}\.phpand validates table existence before running ALTER operations (lines 414-430 indatabase-init.php).Changes
alter_intra_notifications_type_04112025.php→alter_intra_notifications_04112025.phpsetup/database-init.phpline 317Before: File extracts to
intra_notifications_type→ validation failsAfter: File extracts to
intra_notifications→ validation passesThe migration now correctly validates against the existing
intra_notificationstable (created bycreate_intra_notifications_03112025.php) and modifies thetypecolumn to acceptsystemas a notification type.Preventive Measures Added
Following analysis of all 58 migration files (which found 0 additional critical issues), this PR adds preventive tooling:
Migration Validation Tool (
setup/validate-migrations.php)composer db:validateDocumentation (
setup/MIGRATIONS.md)Analysis Results
These tools will help prevent similar naming issues in the future by catching them during development rather than at deployment.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.