Opened 6 years ago

Closed 6 years ago

#30186 closed New feature (fixed)

Show applied datetime in showmigrations

Reported by: Timothy Schilling Owned by: Timothy Schilling
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: migrations showmigrations
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 (last modified by Timothy Schilling)

My idea is to add the applied datetime value to the showmigrations command.

I've run into the case where I'm working on a branch that involves a number of migrations across various apps, but then have to switch to a different branch which has different migrations. It can be troublesome to determine which migrations are new and need to be rolled back. I've recently started looking at the django_migrations table sorted on the applied column to determine which I've run recently. This would make switching between branches involving conflicting migrations easier.

There was some brief discussion here.

I've initially implemented this so that it would only apply to the --list option with a --verbosity of 2 and above. Here's what I have so far. I wasn't sure how to handle backporting.

PR

Edited to strikeout old PR and reference the one to origin.

Change History (8)

comment:1 by Tim Graham, 6 years ago

Has patch: unset
Triage Stage: UnreviewedAccepted

We're past the feature freeze for 2.2, so please target the patch for 3.0 and send the pull request to django/django rather than to your fork.

comment:2 by Ryan Siemens, 6 years ago

Has patch: set
Patch needs improvement: set

comment:3 by Ryan Siemens, 6 years ago

Has patch: unset
Patch needs improvement: unset

Whoops, didn't realize the link was a PR to a fork and not to origin!

Last edited 6 years ago by Ryan Siemens (previous) (diff)

comment:4 by Timothy Schilling, 6 years ago

Description: modified (diff)
Has patch: set
Owner: changed from nobody to Timothy Schilling
Status: newassigned
Version 0, edited 6 years ago by Timothy Schilling (next)

comment:5 by Carlton Gibson, 6 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Carlton Gibson, 6 years ago

Just needs a squash and a rebase.

comment:7 by Tim Graham <timograham@…>, 6 years ago

In 371ddade:

Refs #30186 -- Changed MigrationRecorder.applied_migrations() to return a dict.

comment:8 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 7c68cea:

Fixed #30186 -- Made showmigrations --list display the applied datetimes at verbosity 2+.

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