[Django] #31007: Make it possible to change the default AutoField to BigAutoField

53 views
Skip to first unread message

Django

unread,
Nov 20, 2019, 9:16:16 AM11/20/19
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField
-------------------------------------+-------------------------------------
Reporter: Caio | Owner: Caio Ariede
Ariede |
Type: New | Status: assigned
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This was initially proposed in this comment/PR:
https://github.com/django/django/pull/8924#issuecomment-516792989

1. I really like the proposed approach of having a `DEFAULT_AUTOFIELD`
setting.
2. For backwards compatibility, when `DEFAULT_AUTOFIELD` is not set, we
should keep the default behavior: `django.db.models.AutoField`
3. Whenever this setting is changed, it would affect all existing AND new
fields (pk and fk)

--
Ticket URL: <https://code.djangoproject.com/ticket/31007>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 25, 2019, 2:36:17 PM11/25/19
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Caio
| Ariede
Type: New feature | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: assigned => closed
* resolution: => wontfix


Comment:

I think we need a discussion and consensus on the DevelopersMailingList
before we move forward with this ticket. Adding a new setting is always a
bit controversial and changing the "default" `AutoField` for all tables is
a complicated and error-prone task. That's why we need a clear path, I'm
closing before we finish a discussion.

--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:1>

Django

unread,
Jun 11, 2020, 11:33:44 AM6/11/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Caio
| Ariede
Type: New feature | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tom Forbes):

Proposal: https://groups.google.com/d/msg/django-
developers/MBPEPKlibGQ/F4i6JPvBAAAJ

--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:2>

Django

unread,
Jun 17, 2020, 8:55:56 AM6/17/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Caio
| Ariede
Type: New feature | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tom Forbes):

* cc: Tom Forbes (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:3>

Django

unread,
Jul 11, 2020, 5:09:56 PM7/11/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Caio
| Ariede
Type: New feature | Status: new

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tom Forbes):

* status: closed => new
* resolution: wontfix =>


Comment:

Re-opening as per the mailing list discussion where we have broad
consensus, and a good two-phase plan of action.

--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:4>

Django

unread,
Jul 11, 2020, 5:35:32 PM7/11/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: assigned

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tom Forbes):

* owner: Caio Ariede => Tom Forbes
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:5>

Django

unread,
Jul 12, 2020, 1:12:10 PM7/12/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tom Forbes):

* needs_docs: 0 => 1
* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/13179

--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:6>

Django

unread,
Jul 14, 2020, 2:20:26 AM7/14/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:7>

Django

unread,
Jul 18, 2020, 5:21:35 PM7/18/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tom Forbes):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:8>

Django

unread,
Oct 28, 2020, 10:27:45 AM10/28/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tom Forbes):

* needs_better_patch: 1 => 0


Comment:

Addressed review comments and improved the implementation a bit.

--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:10>

Django

unread,
Dec 4, 2020, 2:18:12 AM12/4/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:11>

Django

unread,
Dec 10, 2020, 5:21:44 AM12/10/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:12>

Django

unread,
Dec 15, 2020, 5:46:50 AM12/15/20
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed

* resolution: => fixed


Comment:

In [changeset:"b5e12d490af3debca8c55ab3c1698189fdedbbdb" b5e12d49]:
{{{
#!CommitTicketReference repository=""
revision="b5e12d490af3debca8c55ab3c1698189fdedbbdb"
Fixed #31007 -- Allowed specifying type of auto-created primary keys.

This also changes the default type of auto-created primary keys
for new apps and projects to BigAutoField.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:13>

Django

unread,
May 18, 2021, 7:33:52 AM5/18/21
to django-...@googlegroups.com
#31007: Make it possible to change the default AutoField to BigAutoField.
-------------------------------------+-------------------------------------
Reporter: Caio Ariede | Owner: Tom
| Forbes
Type: New feature | Status: closed
Component: Database layer | Version: dev

(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"f07723aa0a094d55cc47417492046d613c6ab349" f07723aa]:
{{{
#!CommitTicketReference repository=""
revision="f07723aa0a094d55cc47417492046d613c6ab349"
Refs #31007 -- Added test for check for specifying type of auto-created
primary keys from abstract models.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31007#comment:14>

Reply all
Reply to author
Forward
0 new messages