1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.8.x] Revert "Fixed #24075 -- Prevented running post_migrate signals when unapplying initial migrations of contenttypes and auth"

This reverts commit 737d24923a.

Backport of 2832a9b028 from master
This commit is contained in:
Markus Holtermann
2015-02-07 19:34:15 +01:00
parent b2b5ea88b7
commit edbf6de753
6 changed files with 10 additions and 63 deletions

View File

@@ -5,11 +5,10 @@ import os
import sys
from django.apps import apps
from django.db import connection
from django.db.migrations.recorder import MigrationRecorder
from django.db.migrations.graph import MigrationGraph, NodeNotFoundError
from django.utils import six
from django.conf import settings
from django.db.migrations.graph import MigrationGraph, NodeNotFoundError
from django.db.migrations.recorder import MigrationRecorder
from django.utils import six
MIGRATIONS_MODULE_NAME = 'migrations'
@@ -340,14 +339,3 @@ class AmbiguityError(Exception):
Raised when more than one migration matches a name prefix
"""
pass
def is_latest_migration_applied(app_label):
# TODO: Remove when migration plan / state is passed (#24100).
loader = MigrationLoader(connection)
loader.load_disk()
leaf_nodes = loader.graph.leaf_nodes(app=app_label)
return (
leaf_nodes and leaf_nodes[0] in loader.applied_migrations or
app_label in loader.unmigrated_apps
)