#27871: Django keeps making the same migration over and over again
-------------------------------+--------------------------------------
     Reporter:  Kyle Agronick  |                    Owner:  nobody
         Type:  Bug            |                   Status:  closed
    Component:  Migrations     |                  Version:  1.10
     Severity:  Normal         |               Resolution:  needsinfo
     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 z00sts):

 Greetings from 2020!

 Met this issue today with models like this:
 {{{
 class CRITICALITY(models.ChoiceEnum):
     LOW = 'low'
     NORMAL = 'normal'
     HIGH = 'high'

 class Detection(models.Model):
     criticality = models.CharField(
         max_length=10, choices=CRITICALITY.choices(),
 default=CRITICALITY.NORMAL,
     )
     notification = models.ForeignKey(
         'notifications.UserNotification', related_name='+', blank=True,
 null=True,
         on_delete=models.SET_NULL
     )
 }}}

 `makemigrations` generates similar migration on every run:

 {{{
 # Generated by Django 2.2.3 on 2020-09-02 08:29

 from django.db import migrations, models
 import django.db.models.deletion


 class Migration(migrations.Migration):

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

     operations = [
         migrations.AlterField(
             model_name='detection',
             name='notification',
             field=models.ForeignKey(blank=True, null=True,
 on_delete=django.db.models.deletion.SET_NULL, related_name='+',
 to='notifications.UserNotification'),
         ),
     ]
 }}}


 p.s.
 {{{
 Python 3.6.8
 Django                        2.2.3
 django-cors-headers           3.0.2
 django-db-geventpool          3.1.0
 django-debug-toolbar          1.9.1
 django-filter                 2.1.0
 django-redis                  4.10.0
 django-sendfile2              0.4.2
 djangorestframework           3.9.4
 pytest-django                 3.6.0
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/27871#comment:12>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.b9763e132c1114659bcbb3a0803221ce%40djangoproject.com.

Reply via email to