fanout / django-eventstream

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

Update Model PKs for Django 3.2 (fixes #75) #76

Closed Zoidmania closed 2 years ago

Zoidmania commented 2 years ago

See #75.

I considered changing the PKs to BigAutoField, since BigAutoField was introduced in Django 1.10 (meaning such a change likely wouldn't break compatibility with older Django versions). However, changing the field type means a database migration for current users, which doesn't really solve the problem.

Instead, I opted to manually define the PK fields in the model and update the initial migration file accordingly. This way, existing databases won't need to be changed.

Lastly, I didn't add a default_auto_field setting in the app config because it's new in Django 3.2; the setting didn't exist in previous versions, and I don't want to cause issues with unused setting fields in older versions.

jkarneges commented 2 years ago

Thanks. This seems like a good approach, to avoid everyone suddenly having to run migrations.

Then in the future we can more thoughtfully consider whether to use BigAutoField, probably as part of a major version bump.