Initial data with migrations vs fixtures

419 views
Skip to first unread message

Tom Evans

unread,
Dec 1, 2016, 12:09:49 PM12/1/16
to django...@googlegroups.com
Hi all

We're moving a project over to the latest release (well, we're at 1.7
now, but that's the end goal anyway) and replacing South migrations
with Django migrations.

It looks like that fixtures are no longer thought of as the correct
way of providing initial data. Is this because Run{SQL,Python} can
have "reverse" instructions included, or is it some other reason? I
couldn't see anything pertinent in the docs.

Given that we have an existing project and fixture files, is it very
bad and wrong to simply have a data migration that runs loaddata on
our required fixtures? It would not be reversible, but it would be
massively simpler.

Cheers

Tom

Tim Graham

unread,
Dec 1, 2016, 12:56:11 PM12/1/16
to Django users
Calling loaddata in a migration will work until you modify the model's fields. You can read more on Trac: https://code.djangoproject.com/ticket/24778
Reply all
Reply to author
Forward
0 new messages