Opened 5 years ago

Closed 5 years ago

#30661 closed New feature (fixed)

Add support for SmallAutoField.

Reported by: Nick Pope Owned by: Nick Pope
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: autofield, smallautofield, smallintegerfield
Cc: 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

We have AutoField and BigAutoField that mirror IntegerField and BigIntegerField, but there is no SmallAutoField for SmallIntegerField.

It can be useful to have an auto-incrementing 16-bit integer field for infrequently updated tables that contain a list of choices, e.g. countries, for systems where limited disk space/memory is available.

(In part this was also a test for the changes in #29979.)

Change History (6)

comment:1 by Nick Pope, 5 years ago

Has patch: set

comment:2 by Carlton Gibson, 5 years ago

Wondering if this is sufficiently useful to be part of core? (It seems a bit niche.) Seems like the sort of thing we often recommend putting in the third-party field (and package).

comment:3 by Mariusz Felisiak, 5 years ago

Triage Stage: UnreviewedAccepted

I'm going to accept this based on Anssi's comments (comment:9 and comment:1). I think it's worth to add this for consistency and "small" optimization.

comment:4 by Nick Pope, 5 years ago

Split into new PR.

comment:5 by Mariusz Felisiak, 5 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 194d1dfc:

Fixed #30661 -- Added models.SmallAutoField.

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