jazzband / django-newsletter

An email newsletter application for the Django web application framework, including an extended admin interface, web (un)subscription, dynamic e-mail templates, an archive and HTML email support.
GNU Affero General Public License v3.0
852 stars 206 forks source link

Auto-generated migration after clean install (Django 2.1) #267

Open gabn88 opened 5 years ago

gabn88 commented 5 years ago

On commit 30c3ec3f3bea93b22c6640aed40ee2c8040a4f46 when I run makemigrations I get a new migration (0005). This is on Django 2.1, but I don't think that will affect it.

Alter field subscriptions on submission

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('newsletter', '0004_auto_20180407_1043'),
    ]

    operations = [
        migrations.AlterField(
            model_name='submission',
            name='subscriptions',
            field=models.ManyToManyField(blank=True, db_index=True, help_text='If you select none, the system will automatically find the subscribers for you.', limit_choices_to={'subscribed': True}, to='newsletter.Subscription', verbose_name='recipients'),
        ),
    ]

Maybe this migration should be added to the package, as I don't like having 'self-generated' migrations inside a package.

dokterbob commented 5 years ago

But what is the actual change in this migration?

gabn88 commented 5 years ago

The limit_choices_to={'subscribed': True} appears to be new, just as the db_index. At least, when I compare with the initial migration.

dokterbob commented 5 years ago

This is weird. I'd really like to be sure whether this is is a Django 2.1 thing or whether this pertains to a specific change on our side. And if so, which change. In the latter case, I will happily merge a PR with reference to this particular change.

newearthmartin commented 5 years ago

Also happening here, I recently migrated from django 1.11 to django 2.0 and it creates a new migration for newsletter.

gabn88 commented 5 years ago

Happened again.

# Generated by Django 2.2.7 on 2019-11-22 21:11

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('newsletter', '0004_auto_20180407_1043'),
    ]

    operations = [
        migrations.AlterField(
            model_name='submission',
            name='subscriptions',
            field=models.ManyToManyField(blank=True, db_index=True, help_text='If you select none, the system will automatically find the subscribers for you.', limit_choices_to={'subscribed': True}, to='newsletter.Subscription', verbose_name='recipients'),
        ),
    ]