Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31630 closed Cleanup/optimization (fixed)

Replace DatabaseFeatures.introspected_*_field_type attributes with a single attribute.

Reported by: Tim Graham Owned by: Hasan Ramezani
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
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

The current database features to specify the field that a database introspects are:

  • introspected_big_auto_field_type
  • introspected_small_auto_field_type
  • introspected_boolean_field_type

CockroachDB could also use:

  • introspected_integer_field_type (CockroachDB introspects IntegerField as BigIntegerField)
  • introspected_char_field_type (CockroachDB introspects CharField as TextField)

Rather than adding those attributes, I think it could be more useful to add DatabaseFeatures.introspected_field_type which would be a dictionary mapping each field class to the type it's introspected as.

Change History (8)

comment:1 by Mariusz Felisiak, 4 years ago

Summary: Replace DatabaseFeatures.introspected_*_field_type attributes with a single attributeReplace DatabaseFeatures.introspected_*_field_type attributes with a single attribute.
Triage Stage: UnreviewedAccepted

comment:2 by Hasan Ramezani, 4 years ago

Has patch: set
Owner: changed from nobody to Hasan Ramezani
Status: newassigned

comment:3 by Tim Graham, 4 years ago

Patch needs improvement: set

As noted on the PR, I'm doing a little more work before marking this as ready for checkin.

comment:4 by Tim Graham, 4 years ago

Patch needs improvement: unset

I added two commits to the PR which finishes the work.

comment:5 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In e198bea:

Fixed #31630 -- Replaced introspection features with DatabaseFeatures.introspected_field_types.

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In e24b63fe:

Refs #31630 -- Removed DatabaseFeatures.can_introspect_autofield.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In a7b4a04d:

Refs #31630 -- Added CharField and IntegerField to DatabaseFeatures.introspected_field_types.

CockroachDB introspects CharField as TextField and IntegerField as
BigIntegerField.

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