Django 1.7 data migrations?

285 views
Skip to first unread message

Kent Engström

unread,
Feb 10, 2014, 2:14:28 PM2/10/14
to django-d...@googlegroups.com
I just had a look at the Django 1.7 migrations docs at
https://docs.djangoproject.com/en/dev/topics/migrations/

In South, I've learned to use schema migrations and data migrations
together, for situations like when you need to combine two fields, or
split them (schema migration to add new fields, data migration to copy
data, schema migration to remove old fields).

Is the new built-in system supposed to handle data migrations too? Is so,
how? I did not find a documented place to put arbitrary Python code in
the new declarative format.

If not: how is that need handled in the future? Migrate to point X, run
a script, continue to migrate?

Should this be mentioned somewhere in the docs?


Sorry if I'm confused about this,
/ Kent Engström, Lysator

Andrew Godwin

unread,
Feb 10, 2014, 2:19:18 PM2/10/14
to django-d...@googlegroups.com
Hi Kent,

The documentation is not yet complete, hence your confusion. There is indeed provision for data migrations in the new system, with an operation called RunPython - I'll see if I can get documentation up for it this week.

Andrew



--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/m3d2iupyp7.fsf%40lysator.liu.se.
For more options, visit https://groups.google.com/groups/opt_out.

Kent Engström

unread,
Feb 10, 2014, 2:29:38 PM2/10/14
to django-d...@googlegroups.com
Andrew Godwin <and...@aeracode.org> writes:
> Hi Kent,
>
> The documentation is not yet complete, hence your confusion. There is
> indeed provision for data migrations in the new system, with an
> operation called RunPython - I'll see if I can get documentation up
> for it this week.

OK, splendid! :-) I guess I was fooled by the polished look of that incomplete
page.

Thanks for all your work on South --- you've saved me a lot of time and
tears over the years!

/ Kent Engström, Lysator

Andrew Godwin

unread,
Feb 12, 2014, 2:20:05 PM2/12/14
to django-d...@googlegroups.com
To follow up on this, I've just pushed some documentation for this up - you can see it at https://docs.djangoproject.com/en/dev/topics/migrations/#data-migrations

Feedback welcome!

Andrew



/ Kent Engström, Lysator

--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
Reply all
Reply to author
Forward
0 new messages