Closed
Description
Describe the bug
Kiwi TCMS uses simple-history as dependency. Until recently we had version 2.5.1 and we've upgraded to 2.6.0. The problem is that with 2.5.1 ./manage.py migrate/makemigrations doesn't detect any new changes but with 2.6.0 it does.
Here's how the initial migration looks like:
from django.db import migrations, models
migrations.AddField(
model_name='testplan',
name='parent',
field=models.ForeignKey(blank=True, null=True, on_delete=models.deletion.CASCADE,
related_name='child_set', to='testplans.TestPlan'),
),
migrations.CreateModel(
name='HistoricalTestPlan',
fields=[
('parent', models.ForeignKey(blank=True, db_constraint=False, null=True,
on_delete=models.deletion.DO_NOTHING, related_name='+',
to='testplans.TestPlan')),
]
)
Here's what makemigrations
produces with 2.6.0:
import django.db.models.deletion
migrations.AlterField(
model_name='historicaltestplan',
name='parent',
field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='testplans.HistoricalTestPlan'),
),
The only difference I see is how we reference the on_delete
constraint.
To Reproduce
Steps to reproduce the behavior:
- git clone https://github.com/kiwitcms/Kiwi/
- pip install -r requirements/devel.txt
- ./manage.py migrate
- ./manage.py makemigrations <--- produces a new migration
Repeat the above with 2.5.1 instead and the last step tells you there are no changes detected
Environment (please complete the following information):
- OS: Linux, RHEL 7
- Django Simple History Version: 2.5.1 and 2.6
- Django Version: 2.1.5
- Database Version: SQLite