Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

evidens
Copy link
Contributor

@evidens evidens commented Nov 25, 2011

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

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
@ojii
Copy link
Contributor

ojii commented Dec 21, 2011

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?

@evidens
Copy link
Contributor Author

evidens commented Dec 21, 2011

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
The package on PyPi has not yet been updated though.

@kezabelle
Copy link
Contributor

Anecdotal confirmation, having cherry-pick'd: With an existing database, re-running migrate skips everything, because as beyondwords says, it just tests the south_migrationhistory table (I can't remember whether it's a hard or soft match, but it doesn't matter for this changeset). Additionally, running python manage.py syncdb --all && python manage.py migrate --fake still works, as does doing python manage.py syncdb && python manage.py migrate

I've only done so using the SQLite driver, but it should be the same across the board. Quick, get Jenkins on it!

@ojii
Copy link
Contributor

ojii commented May 22, 2012

really sorry to only actually look at this now, but why is there javascript changes in this pull request?

@ojii
Copy link
Contributor

ojii commented Jun 1, 2012

needs cleanup (remove the JS fixes from this pull request), other than that LGTM.

@yakky
Copy link
Member

yakky commented Jun 8, 2012

Actually only beyondwords@8e2650f851817fb21a0cc547260e4759bcd9d275 looks relevant while others look like github cruft.

@beniwohli
Copy link
Contributor

Closed in favor of #1270 which only contains the schema migration changes

@beniwohli beniwohli closed this Jun 9, 2012
@evidens
Copy link
Contributor Author

evidens commented Jun 9, 2012

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

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.

5 participants