Opened 5 years ago

Closed 4 years ago

#31516 closed Cleanup/optimization (fixed)

Change automatic migration naming from date-based to operation-based

Reported by: Adam Johnson Owned by: Manav Agarwal
Component: Migrations Version: 3.0
Severity: Normal Keywords:
Cc: Carles Pina Estany 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

Following #31468 and a discussion on django-developers with broad consensus, change the way migrations are automatically named from date-based to operation-based. That is never name migrations based upon the current date (auto_YYYYMMDD) and instead always based on the operations they contain, rather than the current behaviour which uses either style.

Change History (16)

comment:1 by Carlton Gibson, 5 years ago

Triage Stage: UnreviewedAccepted

It looks like a luke-warmish OK on the list, so I guess we should push it forward to review. Thanks Adam.

comment:2 by Carles Pina Estany, 5 years ago

Cc: Carles Pina Estany added

comment:3 by Mariusz Felisiak, 4 years ago

Owner: changed from nobody to Adam Johnson
Patch needs improvement: set

comment:4 by Manav Agarwal, 4 years ago

Just a vague idea but I personally feel would be good to implement. In order to avoid ellipsis in the name refer this comment. We may add a suffix like "_+26" (in case there are 26 other operations).
This is just a vague representation but I feel if we may implement something like this, it would be a better option. Need some suggestions.
I would be happy to submit a PR for this.

Version 1, edited 4 years ago by Manav Agarwal (previous) (next) (diff)

comment:5 by Manav Agarwal, 4 years ago

Owner: changed from Adam Johnson to Manav Agarwal

comment:6 by Manav Agarwal, 4 years ago

Patch needs improvement: unset

comment:7 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:8 by Manav Agarwal, 4 years ago

Patch needs improvement: unset

comment:9 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:10 by Manav Agarwal, 4 years ago

Patch needs improvement: unset

comment:11 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:12 by Manav Agarwal, 4 years ago

Patch needs improvement: unset

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

In b1cb9238:

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

comment:14 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin
Type: New featureCleanup/optimization

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

In 927fead2:

Refs #31516 -- Added Migration.suggest_name() tests for migrations with no operations.

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

Resolution: fixed
Status: assignedclosed

In 99640e24:

Fixed #31516 -- Improved naming of migrations with multiple operations.

52 gives 60 in total (52 + 5 + 3).

Co-authored-by: Adam Johnson <me@…>

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