#24543: Add checks / command options for "migrations not applied" and 
"migrations
needed"
-----------------------------+--------------------
     Reporter:  blueyed      |      Owner:  nobody
         Type:  New feature  |     Status:  new
    Component:  Migrations   |    Version:  master
     Severity:  Normal       |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0            |      UI/UX:  0
-----------------------------+--------------------
 The `runserver` command prints a notice in case migrations are not
 applied:

     def check_migrations(self):
         """
         Checks to see if the set of migrations on disk matches the
         migrations in the database. Prints a warning if they don't match.
         """
         executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
         plan = executor.migration_plan(executor.loader.graph.leaf_nodes())
         if plan:
             self.stdout.write(self.style.NOTICE("\nYou have unapplied
 migrations; your app may not work properly until they are applied."))
             self.stdout.write(self.style.NOTICE("Run 'python manage.py
 migrate' to apply them.\n"))


 I would like to use this test during deployment.

 Maybe this would be appropriate for the new `--deploy` option for the
 check
 command introduced in Django 1.8?


 Additionally, I'd like to check if there are no migrations required, which
 I
 currently test by looking for `"No changes detected"` in `makemigrations
 --dry-run`.


 Even when this doesn't fit into the checks system, there should be a
 supported
 way to get theses information by means of return codes from a command.

--
Ticket URL: <https://code.djangoproject.com/ticket/24543>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.e465567787d71fda089fdeb7aaacb9bf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to