#23474: Schema migrations can inadvertently destroy data
-------------------------------+--------------------------------------
     Reporter:  Naddiseo       |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Migrations     |                  Version:  1.7
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by Naddiseo):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Here a more relevant use-case. I'm moving my project to django 1.7 and
 already have data, so I create the initial migrations, then fake them.
 Next I migrate the first migration of another app (maybe by accident I
 forget the `--fake`), and voila, my data is gone.

 {{{#!bash

 $ unzip unapp.zip
 $ cd unapp/
 $ sqlite3 db.sqlite3 ".tables"
 B_b
 $ manage migrate --fake B
 Operations to perform:
   Apply all migrations: B
 Running migrations:
   Applying A.0001_initial... FAKED
   Applying B.0001_initial... FAKED
   Applying B.0002_b... FAKED
 $ sqlite3 db.sqlite3 ".tables"
 B_b                django_migrations
 $ manage migrate A  0001
 Operations to perform:
   Target specific migration: 0001_initial, from A
 Running migrations:
   Unapplying B.0002_b... OK
   Unapplying B.0001_initial... OK
 $ sqlite3 db.sqlite3 ".tables"
 django_migrations
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23474#comment:1>
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/066.579aca00be57de0b992616de69f5a382%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to