#24375: Add ability to mark migration as fake in Migration
-----------------------------+-----------------------------
     Reporter:  haeric       |      Owner:  nobody
         Type:  New feature  |     Status:  new
    Component:  Migrations   |    Version:  1.7
     Severity:  Normal       |   Keywords:  fake migrations
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0            |      UI/UX:  0
-----------------------------+-----------------------------
 I would like to add a property on a Migration to always fake it. Here's
 the use-case:

 I'm doing initial migrations on an existing database. Two apps have a
 circular dependency, so I break out the migrations like this:
 a.0001_initial
 a.0002_add_field_that_caused_circular_error
 b.0001_initial

 Running manage.py migrate will run a.0001 and b.0001 as faked
 automatically, but a.0002 will fail because it isn't the first migration
 in the app, and because it isn't a CreateModel. So I would have to
 manually run "manage.py migrate a 0002 --fake".

 The above seems fine if you have one database in one state, and have to do
 this once. In any system with multiple environments, with multiple states
 of the database, with a lot of automation,  where you could normally just
 run migrate and it always get your database up to speed, you now have to
 write a script that does 0002 --fake if the migrations have not been run
 yet for app a, otherwise NOT do it. This is very tedious.

 Adding a flag to migrations that it always be faked would solve it, so I
 could go back to always just running "migrate". If there are other
 solutions that are better for getting around it, I'm all ears :)

--
Ticket URL: <https://code.djangoproject.com/ticket/24375>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.cdd0d6083c3c30de6a4a7f99463c52f6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to