Opened 8 years ago

Closed 8 years ago

#25855 closed Cleanup/optimization (fixed)

Improve runserver migration notification output.

Reported by: Keryn Knight Owned by: Emre Yılmaz
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: django@…, hello@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Firstly, it uses the word "app" when it's actually over the whole project, and may span multiple apps, to use the Django nomenclature.

Additionally, I think it would be nicer to know what might need applying. At the very least, the number should be easy enough to ascertain (len(plan) I'd assume), changing the message to something like:

You have 3 unapplied migrations; your project may not work correctly until apps [auth, bob, myapp] have their migrations applied.

would overall be preferable; the names can I think be gained via sorted(set(x[0].app_label for x in plan))

Could be easy pickings if accepted.

Attachments (2)

0001-Fixed-25855-Added-more-accurate-info-to-migration.diff (1.2 KB ) - added by Emre Yılmaz 8 years ago.
Patch for ticket #25855
0001-Fixed-25855-Added-more-accurate-info-to-migration.diff​ (5.4 KB ) - added by Emre Yılmaz 8 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Claude Paroz, 8 years ago

Triage Stage: UnreviewedAccepted

More accurate messages (when possible) are always welcome.

comment:2 by Tim Graham, 8 years ago

Easy pickings: set

comment:3 by Emre Yılmaz, 8 years ago

Cc: hello@… added

Related pull request is on github:
https://github.com/django/django/pull/5765

by Emre Yılmaz, 8 years ago

Patch for ticket #25855

comment:4 by Emre Yılmaz, 8 years ago

Owner: changed from nobody to Emre Yılmaz
Status: newassigned

comment:5 by Claude Paroz, 8 years ago

Has patch: set
Needs tests: set

To be seen if tests are doable in this part of the code.

comment:6 by Emre Yılmaz, 8 years ago

Couldn't find a good way to test this with the current test structure. Any starting point?

comment:7 by Claude Paroz, 8 years ago

It might be possible to instanciate a runserver Command and to call check_migrations without running the command itself.

comment:8 by Emre Yılmaz, 8 years ago

Just added the related unit tests and updated the pull request on github:

https://github.com/django/django/pull/5765

comment:9 by Tim Graham, 8 years ago

Easy pickings: unset
Needs tests: unset

Don't forget to uncheck the appropriate ticket flags after updating a patch ("Needs tests" in this case). Also, you don't need to add a patch on the ticket when you also send a pull request. Thanks!

comment:10 by Emre Yılmaz, 8 years ago

Sorry, trac is a new thing for me :-)

thanks for the heads up.

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

Resolution: fixed
Status: assignedclosed

In 63a6a653:

Fixed #25855 -- Enhanced the migration warning for runserver.

Added unapplied migration count and the list of unmigrated apps.

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