-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Primary keys with Django 3.2+ #126
Comments
Now that our trove classifier has been updated for Django 3.2, I wonder what all we need to do to better support this. |
https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys Define Notice that if there are 10 million users, and each user has 200 friendship requests or 200 friends, then it's already 2 billion records. And of course, generate and commit the migrations if necessary. |
It looks like #146 hasn't been released to production, CHANGELOG.rst not updated so I guess you closed this issue too early. |
Adding
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
in settings creates new migrations for django-friendship with Django 3.2+. I think it's better to define the primary keys to allow big integers in the app and add the migrations. django-friendship may be used in a database where there are more than 2**31 friendship requests or other models, and it's better to useBigAutoField
than the defaultAutoField
, and also to define those in the app and not to rely on the site's settings. When relying on settings a migration is created within django-friendship, but this package is installed as it is and should include all its migrations.If I use django-friendship as it is without defining
DEFAULT_AUTO_FIELD
in settings, I get these warnings with Django 3.2 alpha:Tested with Django 3.2 alpha.
The text was updated successfully, but these errors were encountered: