Create schema migrations for all apps specified in INSTALLED_APPS,
    then run a migrate command.

def migrate_all():
    """
    Create schema migrations for all apps specified in INSTALLED_APPS,
    then run a migrate command.
    """
    if 'south' in settings.INSTALLED_APPS:
        return _south_migrate_all()
    from django.core.management.commands import makemigrations, migrate
    schema_args = [sys.executable, 'makemigrations']
    for app in settings.INSTALLED_APPS:
        if not app.startswith('django'):
            schema_args += [app]
    schema_cmd = makemigrations.Command()
    schema_cmd.run_from_argv(schema_args)

    migrate_cmd = migrate.Command()
    sys.stderr.write("MIGRATE ALL!\n")
    return migrate_cmd.run_from_argv([sys.executable, 'migrate'])