-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforcing migration order (related to publisher2) #1098
Conversation
When publisher2 migration in cms deletes the cmspluginpublic table This patch forces the dependent plugins to rename in sync avoiding a MySQL migration error in south
how will this affect existing migration histories? I don't want this to break every installation... Also have you considered contributing your south fork back into the main south? |
This shouldn't affect existing migration histories at all since when you run migrate it checks in the table which migrations have already been run, not the order (or in most people's case syncdb and fake migrate). The added lines are just hints to ensure the migrations are run in an order that remains consistent with the database during the initial migration. I did contribute them back and they are now merged into the main branch of south https://bitbucket.org/andrewgodwin/south/changeset/d310fe2fda97 |
Anecdotal confirmation, having cherry-pick'd: With an existing database, re-running I've only done so using the SQLite driver, but it should be the same across the board. Quick, get Jenkins on it! |
really sorry to only actually look at this now, but why is there javascript changes in this pull request? |
needs cleanup (remove the JS fixes from this pull request), other than that LGTM. |
Actually only beyondwords@8e2650f851817fb21a0cc547260e4759bcd9d275 looks relevant while others look like github cruft. |
Closed in favor of #1270 which only contains the schema migration changes |
Thanks @piquadrat ! This was one of my first patches so I didn't know to branch before submitting (and then didn't get around to re-splitting it). |
MySQL wouldn't run the south migrations as they stand (mostly because of south).
I added better support to south https://bitbucket.org/beyondwords/south-mysql to support foreign key renames, but there were still lingering issues with out-of-date foreign keys.
The easiest fix I found was to enforce that all publisher2 changes in the plugins, follow the one in CMS.
I thought this would be useful to others and minimally invasive to the existing code base.
Hope this is deemed useful.
Cheers,
Gabriel