DEFAULT_AUTO_FIELD

161 views
Skip to first unread message

אורי

unread,
Oct 4, 2021, 4:58:58 AM10/4/21
to Django developers (Contributions to Django itself)
Hi,

Are there any intentions to make DEFAULT_AUTO_FIELD and django.db.models.AutoField a 64-bit integers in future versions of Django?

If not, why not?

Thanks,

Mariusz Felisiak

unread,
Oct 4, 2021, 5:25:56 AM10/4/21
to Django developers (Contributions to Django itself)
Hi,

Are there any intentions to make ... django.db.models.AutoField a 64-bit integers in future versions of Django?
 
`AutoField` is a completely valid field, I don't see a reason to remove it or make it an alias of the `BigAutoField`.
 
Are there any intentions to make DEFAULT_AUTO_FIELD ... a 64-bit integers in future versions of Django?

As far as I'm aware this will not happen in the nearest future (maybe never). I cannot imagine that we would change the default for the DEFAULT_AUTO_FIELD setting before:
  • dropping support for all versions prior to 3.2 (maybe Django 5.0+), and
  • fixing remaining issue with the smooth migration between auto-fields, e.g. #32674.
Best,
Mariusz

Adam Johnson

unread,
Oct 4, 2021, 5:27:36 AM10/4/21
to django-d...@googlegroups.com
The startproject template already uses 64 bit integers, and the default will change in a future version. See the 3.2 release notes ( https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys ) :

Starting with 3.2 new projects are generated with DEFAULT_AUTO_FIELD set to BigAutoField. Also, new apps are generated with AppConfig.default_auto_field set to BigAutoField. In a future Django release the default value of DEFAULT_AUTO_FIELD will be changed to BigAutoField.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CABD5YeGT-O0XMkZjC%3Dh%3DMWcJFEBo%3D%2BzXWpuBFfUsO5vJ3ZLH7g%40mail.gmail.com.

אורי

unread,
Oct 4, 2021, 5:37:20 AM10/4/21
to Django developers (Contributions to Django itself)
Thank you.
 
In a future Django release the default value of DEFAULT_AUTO_FIELD will be changed to BigAutoField.

When do you expect this to happen?

Pavlos Georgiadis

unread,
Oct 5, 2021, 4:37:24 PM10/5/21
to django-d...@googlegroups.com

Hi,

As far as I know this is why BigAutoField is for. I guess the AutoField is there for backwards compatibility.


--
Pavlos Georgiadis

Adam Johnson

unread,
Oct 6, 2021, 6:24:51 AM10/6/21
to django-d...@googlegroups.com
As Mariusz wrote, it depends upon at least the M2M field migration being fixed first.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages