#22837: Migrations detect unnessecary(?) changes
-------------------------------+--------------------------------------
     Reporter:  valberg        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  closed
    Component:  Migrations     |                  Version:  1.7-beta-2
     Severity:  Normal         |               Resolution:  invalid
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by pykler):

 To me this is future proofing since no DBMS (that I know of) has such a
 constraint on char fields (which is what is used here).

 Tell me what the correct behaviour is in the following scenario (according
 to the ticket close comment, this is a scenario that is designed for).

 {{{
 0001 migration   choices are ('a', 'apple'), ('b', 'banana')
 0002 data        insert into table choice 'banana'
 0003 migration   model has only one choice now ('a', 'apple')
 }}}

 From my tests, django doesn't (and 100% defenitely shouldn't) be deleting
 data or replacing data in every record of my database table on migration
 0003. So the reality is, this point in time validation check is really
 only for checking if the choice is valid during the data migration which
 isn't really useful.

 The problem with this design is some apps (third party) will have a
 dynamic set of choices depending on your settings, so they cannot reliably
 deliver a set of migrations causing the user of the app to have to create
 migrations on behalf of the third party app.

 Surely there is a better design out there to solve the scenario where a
 datamigration is somehow validated and no grief is caused to django users.

 PS. I believe django migrations are very elegant even with this little
 design snafu https://twitter.com/pykler/status/546868601492627456

--
Ticket URL: <https://code.djangoproject.com/ticket/22837#comment:3>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a9ad07094fb2556cc7b4de2d254e94d1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to