Commit 12e9804d authored by Andrew Godwin's avatar Andrew Godwin
Browse files

Rename allow_syncdb to allow_migrate

parent 68e0a169
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ def create_permissions(app, created_models, verbosity, db=DEFAULT_DB_ALIAS, **kw
    except UnavailableApp:
        return

    if not router.allow_syncdb(db, auth_app.Permission):
    if not router.allow_migrate(db, auth_app.Permission):
        return

    from django.contrib.contenttypes.models import ContentType
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ def update_contenttypes(app, created_models, verbosity=2, db=DEFAULT_DB_ALIAS, *
    except UnavailableApp:
        return

    if not router.allow_syncdb(db, ContentType):
    if not router.allow_migrate(db, ContentType):
        return

    ContentType.objects.clear_cache()
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ class OtherRouter(object):
    def allow_relation(self, obj1, obj2, **hints):
        return None

    def allow_syncdb(self, db, model):
    def allow_migrate(self, db, model):
        return True


+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ from django.core.management.color import no_style

def create_default_site(app, created_models, verbosity, db, **kwargs):
    # Only create the default sites in databases where Django created the table
    if Site in created_models and router.allow_syncdb(db, Site) :
    if Site in created_models and router.allow_migrate(db, Site) :
        # The default settings set SITE_ID = 1, and some tests in Django's test
        # suite rely on this value. However, if database sequences are reused
        # (e.g. in the test suite after flush/syncdb), it isn't guaranteed that
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class Command(LabelCommand):
    def handle_label(self, tablename, **options):
        db = options.get('database')
        cache = BaseDatabaseCache(tablename, {})
        if not router.allow_syncdb(db, cache.cache_model_class):
        if not router.allow_migrate(db, cache.cache_model_class):
            return
        connection = connections[db]
        fields = (
Loading