﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24543	"Add checks / command options for ""migrations not applied"" and ""migrations needed"""	Daniel Hahler	nobody	"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.
"	New feature	new	Migrations	dev	Normal				Unreviewed	0	0	0	0	0	0
