Saturday, September 27, 2014

Re: Upgrading Django (to 1.7)

The problem we ran into was not with the order of migrations, it was that all of the migrations were running with the latest models.py code. The data migration was trying to move data from one model field to another model field, and the "from" field had been deleted from models.py. 

This was awhile ago, and my memory might be faulty. Do the latest migrations give you any way to deal with that situation? I mean, do they migrate the models in models.py in sync with the the database schema migrations?

I can see where a data migration might work in a schema migration sequence if you expressed it all in SQL, just dealing with the database alone, but we of course wrote in Python using the Django ORM.

On Friday, September 26, 2014 10:04:49 AM UTC-5, Fred Stluka wrote:
Bob,

You can control the order in which migrations run.

For South, see "depends_on" and "needed_by":
- http://south.readthedocs.org/en/latest/dependencies.html

For Django 1.7 migrations, see "dependencies":
- https://docs.djangoproject.com/en/dev/topics/migrations/#dependencies

--Fred

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/418bd491-1068-4688-af2a-9754802b988c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment