why django 1.9 migrations are essential?

143 views
Skip to first unread message

skyjur

unread,
Nov 11, 2015, 3:49:39 PM11/11/15
to Django developers (Contributions to Django itself)
Back before django got migrations with south it was possible to do:

   syncdb --all (create all tables old way)
   migrate --fake (mark all migrations done)

This flow was very useful in tests as well as when setting up new projects.

I'm a bit confused to as to why django took this route and in 1.9 is making migrations absolutely essential. What are people normally now doing to avoid running possibly numerous number of migrations every test run or every time project is deployed from scratch?

Up until now I was only coming up with workarounds on how to keep my migrations from running in tests and fresh installs.

Hugo Osvaldo Barrera

unread,
Nov 11, 2015, 3:58:00 PM11/11/15
to django-d...@googlegroups.com
 
On Wed, Nov 11, 2015, at 16:47, skyjur wrote:
Back before django got migrations with south it was possible to do:
 
   syncdb --all (create all tables old way)
   migrate --fake (mark all migrations done)
 
Keep in mind that these are not equivalent to running `migrate`. Data migrations would never have been run in this scenario.
 
 
This flow was very useful in tests as well as when setting up new projects.
 
I'm a bit confused to as to why django took this route and in 1.9 is making migrations absolutely essential. What are people normally now doing to avoid running possibly numerous number of migrations every test run or every time project is deployed from scratch?
 
Up until now I was only coming up with workarounds on how to keep my migrations from running in tests and fresh installs.
 
Why would you want to avoid this? What's the problem with creating your tables via migrations instead of syncdb?
 
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" 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.
For more options, visit https://groups.google.com/d/optout.
 
--
Hugo Osvaldo Barrera
 

Tim Graham

unread,
Nov 11, 2015, 3:59:26 PM11/11/15
to Django developers (Contributions to Django itself)
Hi, have you read the 1.9 release notes? Specifically, "When supplying None as a value in MIGRATION_MODULES, Django will consider the app an app without migrations." If so, maybe we need a better description of that.

Andrew Godwin

unread,
Nov 11, 2015, 4:06:25 PM11/11/15
to django-d...@googlegroups.com
Yes, as Tim says, 1.9 actually introduces the ability to mark apps as not having migrations; we specifically chose to keep supporting the migration-less creation format, just as an explicit setting.

Note that you can't give an app migrations normally but run the tests without them; for correctness reasons, you really shouldn't be anyway. There was some work on adding a "MIGRATE" option to be stuck in the TEST key for databases, but it's not landed yet and wouldn't be till 1.10 anyway.

Andrew

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" 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.

Shai Berger

unread,
Nov 11, 2015, 5:45:15 PM11/11/15
to django-d...@googlegroups.com
<p territory="django-users">

use "manage.py test --keepdb" (available since 1.8)

</p>
Reply all
Reply to author
Forward
0 new messages