richardbarran / django-photologue

A customizable plug-in photo gallery management application for the Django web framework.
BSD 3-Clause "New" or "Revised" License
674 stars 239 forks source link

Missing migration #221

Closed rhbvkleef closed 2 years ago

rhbvkleef commented 2 years ago

Presumably, due to the addition of the French translations (#220), the effect field on the photo model needs to be re-migrated.

Error

Your models in app(s): 'photologue' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

Migration

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

class Migration(migrations.Migration):

    dependencies = [
        ('photologue', '0011_auto_20190223_2138'),
    ]

    operations = [
        migrations.AlterField(
            model_name='photo',
            name='effect',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_related', to='photologue.photoeffect', verbose_name='effect'),
        ),
    ]
richardbarran commented 2 years ago

Thanks for the report - it seems that in Django 4.0 running makemigrations might generate no-op AlterField operations for ManyToManyField and ForeignKey fields in some cases. I've added the missing migration as you have suggested & I'm releasing a new version of Photologue.