#22837: Migrations detect unnessecary(?) changes
-------------------------------+------------------------
     Reporter:  valberg        |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Migrations     |    Version:  1.7-beta-2
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+------------------------
 I don't know if this is intended behavior, but having a simple model as:

 {{{
 class Foo(models.Model):
     bar = models.SlugField()
 }}}

 Simple changes, that do have no impact on the database representation,
 result in new migrations. For instance:

 {{{
 class Foo(models.Model):
     bar = models.SlugField(editable=False)
 }}}

 results in:

 {{{
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals

 from django.db import models, migrations


 class Migration(migrations.Migration):

     dependencies = [
         ('testapp', '0001_initial'),
     ]

     operations = [
         migrations.AlterField(
             model_name='foo',
             name='bar',
             field=models.SlugField(editable=False),
         ),
     ]
 }}}

 And further:

 {{{
 class Foo(models.Model):
     bar = models.SlugField(
         editable=False,
         choices=[
             ('baz', 'Baz'),
             ('test', 'Test'),
         ]
     )
 }}}

 Results in:

 {{{
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals

 from django.db import models, migrations


 class Migration(migrations.Migration):

     dependencies = [
         ('testapp', '0002_auto_20140614_2237'),
     ]

     operations = [
         migrations.AlterField(
             model_name='foo',
             name='bar',
             field=models.SlugField(editable=False, choices=[('baz',
 'Baz'), ('test', 'Test')]),
         ),
     ]
 }}}

 It is as if the detector does "too much" detecting. But again there might
 well be a good reason for this. Just thought it would be a good thing to
 address :)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22837>
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/050.b5e0e1e5262abb7b2edc458e022c581d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to