Commit 9aa358ce authored by Marc Tamlyn's avatar Marc Tamlyn
Browse files

Merge pull request #376 from andrewgodwin/schema-alteration

Schema alteration
parents 57c82f90 5569b0b9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -609,3 +609,10 @@ STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

##############
# MIGRATIONS #
##############

# Migration module overrides for apps, by app label.
MIGRATION_MODULES = {}
+3 −3
Original line number Diff line number Diff line
@@ -65,7 +65,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
@@ -188,7 +188,7 @@ def get_default_username(check_db=True):
            return ''
    return default_username

signals.post_syncdb.connect(create_permissions,
signals.post_migrate.connect(create_permissions,
    dispatch_uid="django.contrib.auth.management.create_permissions")
signals.post_syncdb.connect(create_superuser,
signals.post_migrate.connect(create_superuser,
    sender=auth_app, dispatch_uid="django.contrib.auth.management.create_superuser")
+2 −2
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()
@@ -88,7 +88,7 @@ def update_all_contenttypes(verbosity=2, **kwargs):
    for app in get_apps():
        update_contenttypes(app, None, verbosity, **kwargs)

signals.post_syncdb.connect(update_contenttypes)
signals.post_migrate.connect(update_contenttypes)

if __name__ == "__main__":
    update_all_contenttypes()
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ class SpatiaLiteCreation(DatabaseCreation):

        # We need to then do a flush to ensure that any data installed by
        # custom SQL has been removed. The only test data should come from
        # test fixtures, or autogenerated from post_syncdb triggers.
        # test fixtures, or autogenerated from post_migrate triggers.
        # This has the side effect of loading initial data (which was
        # intentionally skipped in the syncdb).
        call_command('flush',
+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


Loading