Opened 10 years ago
Last modified 10 years ago
#24412 closed New feature
Red migration notice should be printed when running tests without --verbosity=2 — at Version 1
Reported by: | Peter Schmidt | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The following quite useful red NOTICE is printed to the command line only when running manage.py test --verbosity=2 --keepdb
(the second time after no migrations are run), and thus buried amongst a lot of other information:
https://github.com/django/django/blob/master/django/core/management/commands/migrate.py#L183-191
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
I think it should be printed at the default manage.py test
(i.e. --verbosity=1
).
This might be complicated by decrementing the verbosity by 1 when calling migrate
inside create_test_db
:
https://github.com/django/django/blob/master/django/db/backends/base/creation.py#L68
Though there are only 16 verbosity strings in migrate.py
(including calls to showmigrations and emit_pre_migrate_signal) so the side effects from that part should be reasonably traceable.
Not sure about not printing the first time (i.e. without --keepdb
) ... any thoughts?