fix(mysql): Fix Sequential Migration Failures#1153
Open
eduardomozart wants to merge 12 commits intognmyt:mainfrom
Open
fix(mysql): Fix Sequential Migration Failures#1153eduardomozart wants to merge 12 commits intognmyt:mainfrom
eduardomozart wants to merge 12 commits intognmyt:mainfrom
Conversation
Update the primary key handling for organization_members migration.
Added MySQL compatibility for foreign key checks during migration.
Added support for MySQL foreign key checks in migration.
Added conditional handling for foreign key checks based on the database dialect before dropping the 'app_sources' table.
Added conditional handling for foreign key checks based on the database dialect.
Add a 'preferences' column to the 'accounts' table with JSON type.
|
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.


📋 Description
All modified migration files retain 100% functionality for existing SQLite users.
0006-update-organization-members-primary-key.jsHAVING MIN(rowid)clause conditional based on the database dialect. MariaDB uses a standardGROUP BYapproach for data migration from backup tables.0011-unified-schema-migration.jsThe
0011-unified-schema-migration.jsfile relied on several raw SQL commands that are exclusive to SQLite. When running Nexterm with a MariaDB or MySQL backend, these commands caused the migration runner to crash, preventing the application from initializing. These changes allow the same migration file to work seamlessly across both database types.PRAGMAcommands withSET FOREIGN_KEY_CHECKSfor MySQL/MariaDB to safely toggle constraints during the migration.SHOW COLUMNSon MySQL/MariaDB instead ofPRAGMA table_infowhen verifying existing table structures.LAST_INSERT_ID()/NOW()for MySQL andlast_insert_rowid()/datetime('now')for SQLite.ALTER TABLEsyntax for adding integrationId to accommodate MySQL's requirement for explicit constraint definitions.0012-add-tags.js,0013-add-keymaps.js,0014-add-session-sync.js,0015-remove-app-sources.js,0016-add-scripts.js,0017-add-organization-to-snippets-and-scripts.js,0020-add-passkeys.js,0020-add-sort-order-to-snippets-and-scripts.jsand0027-add-preferences.jsPRAGMAcommands; they use system variables likeFOREIGN_KEY_CHECKSto control constraint behavior. This modification ensures that the migration script remains functional for users on the default SQLite setup while enabling successful execution on your MariaDB backend.🚀 Changes made to ...
✅ Checklist
🔗 Related Issues
None.