|
@@ -7,7 +7,7 @@ from django.apps import apps
|
|
|
from django.core.management.base import BaseCommand, CommandError
|
|
|
from django.core.management.color import no_style
|
|
|
from django.core.management.sql import emit_post_migrate_signal, sql_flush
|
|
|
-from django.db import DEFAULT_DB_ALIAS, connections, router, transaction
|
|
|
+from django.db import DEFAULT_DB_ALIAS, connections, transaction
|
|
|
from django.utils import six
|
|
|
from django.utils.six.moves import input
|
|
|
|
|
@@ -76,15 +76,8 @@ Are you sure you want to do this?
|
|
|
six.reraise(CommandError, CommandError(new_msg), sys.exc_info()[2])
|
|
|
|
|
|
if not inhibit_post_migrate:
|
|
|
- self.emit_post_migrate(verbosity, interactive, database)
|
|
|
+ # Emit the post migrate signal. This allows individual applications to
|
|
|
+ # respond as if the database had been migrated from scratch.
|
|
|
+ emit_post_migrate_signal(verbosity, interactive, database)
|
|
|
else:
|
|
|
self.stdout.write("Flush cancelled.\n")
|
|
|
-
|
|
|
- @staticmethod
|
|
|
- def emit_post_migrate(verbosity, interactive, database):
|
|
|
- # Emit the post migrate signal. This allows individual applications to
|
|
|
- # respond as if the database had been migrated from scratch.
|
|
|
- all_models = []
|
|
|
- for app_config in apps.get_app_configs():
|
|
|
- all_models.extend(router.get_migratable_models(app_config, database, include_auto_created=True))
|
|
|
- emit_post_migrate_signal(verbosity, interactive, database)
|