Opened 3 years ago

Closed 17 months ago

Last modified 12 months ago

#31007 closed New feature (fixed)

Make it possible to change the default AutoField to BigAutoField.

Reported by: Caio Ariede Owned by: Tom Forbes
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Tom Forbes Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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)

Change History (14)

comment:1 Changed 2 years ago by Mariusz Felisiak

Resolution: wontfix
Status: assignedclosed
Summary: Make it possible to change the default AutoField to BigAutoFieldMake it possible to change the default AutoField to BigAutoField.

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.

comment:3 Changed 2 years ago by Tom Forbes

Cc: Tom Forbes added

comment:4 Changed 23 months ago by Tom Forbes

Resolution: wontfix
Status: closednew

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

comment:5 Changed 23 months ago by Tom Forbes

Owner: changed from Caio Ariede to Tom Forbes
Status: newassigned

comment:6 Changed 23 months ago by Tom Forbes

Has patch: set
Needs documentation: set

comment:7 Changed 23 months ago by Carlton Gibson

Triage Stage: UnreviewedAccepted

comment:8 Changed 22 months ago by Tom Forbes

Needs documentation: unset

comment:9 Changed 20 months ago by Mariusz Felisiak

Patch needs improvement: set

comment:10 Changed 19 months ago by Tom Forbes

Patch needs improvement: unset

Addressed review comments and improved the implementation a bit.

comment:11 Changed 18 months ago by Mariusz Felisiak

Patch needs improvement: set

comment:12 Changed 18 months ago by Mariusz Felisiak

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:13 Changed 17 months ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In b5e12d49:

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.

comment:14 Changed 12 months ago by Mariusz Felisiak <felisiak.mariusz@…>

In f07723aa:

Refs #31007 -- Added test for check for specifying type of auto-created primary keys from abstract models.

Note: See TracTickets for help on using tickets.
Back to Top