fanout / django-eventstream

Server-Sent Events for Django
MIT License
638 stars 84 forks source link

Django 3.2 Changes Default pk Field Type #75

Closed Zoidmania closed 2 years ago

Zoidmania commented 2 years ago

From the docs:

Starting with Django 3.2, the built-in ID/PK field type is BigAutoField.

id = models.BigAutoField(primary_key=True) ... In older versions, auto-created primary key fields were always AutoFields.

This causes a new migration requirement for this package:

operations = [
        migrations.AlterField(
            model_name='event',
            name='id',
            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
        migrations.AlterField(
            model_name='eventcounter',
            name='id',
            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
    ]

The initial model/migration will need to be updated to use BigAutoField, or you can set default id field type in the app config.

How do you want to handle this? Are pull requests preferable?

jkarneges commented 2 years ago

Hmm, well whatever we do, hopefully it can be backwards compatible. Open to pull requests.

squarism commented 2 years ago

Backward compatible to which Django version(s)?

Zoidmania commented 2 years ago

Maybe 2.2, considering channels dependency?