Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31703 closed Cleanup/optimization (fixed)

Name all initial migrations "NNNN_initial".

Reported by: Jon Dufresne Owned by: Jon Dufresne
Component: Migrations 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

When the MigrationAutodetector creates more than one initial migration in a app, name all initial migrations "initial" rather than the opaque "auto_<DATE>_<TIME>" name. This name provides more information to the reader about its origin and is reproducible.

Initial migrations that have a descriptive name can continue to use the more descriptive name.

Change History (8)

comment:2 by Mariusz Felisiak, 4 years ago

Summary: Change MigrationAutodetector to name all initial migraitons "NNNN_initial" rather than "auto_<DATE>_<TIME>"Name all initial migrations "NNNN_initial".
Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 4 years ago

Owner: changed from nobody to Jon Dufresne
Patch needs improvement: set
Status: newassigned

comment:4 by Mariusz Felisiak, 4 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

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

In bce180dd:

Refs #31703 -- Moved MigrationAutodetector.suggest_name() to Migration.

Allows expanding the method to inspect additional attributes of the
migration instance. For example, the Migration.initial attribute.

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

In 01195c4a:

Refs #31703 -- Added Migration.suggest_name() test for initial migration with multiple CreateModels.

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

Resolution: fixed
Status: assignedclosed

In 6f3e3e87:

Fixed #31703 -- Made makemigrations name all initial migrations "initial".

When the MigrationAutodetector creates more than one initial migration
in a app, name all initial migrations "initial" rather than the opaque
"auto_<DATE>_<TIME>" name.

Initial migrations that have a descriptive name continue to use the
descriptive name.

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

In b1cb9238:

Refs #31516, Refs #31703 -- Made makemigrations always name initial migrations "initial".

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