コード例 #1
0
def _sync_extension_repo(extension, version):
    if extension in MIGRATED_EXTENSIONS:
        raise exception.MigrationMovedFailure(extension=extension)

    with sql.session_for_write() as session:
        engine = session.get_bind()

        try:
            package_name = '.'.join((contrib.__name__, extension))
            package = importutils.import_module(package_name)
        except ImportError:
            raise ImportError(_("%s extension does not exist.")
                              % package_name)
        try:
            abs_path = find_migrate_repo(package)
            try:
                migration.db_version_control(engine, abs_path)
            # Register the repo with the version control API
            # If it already knows about the repo, it will throw
            # an exception that we can safely ignore
            except exceptions.DatabaseAlreadyControlledError:  # nosec
                pass
        except exception.MigrationNotProvided as e:
            print(e)
            sys.exit(1)

        _assert_not_schema_downgrade(extension=extension, version=version)

        init_version = get_init_version(abs_path=abs_path)

        migration.db_sync(engine, abs_path, version=version,
                          init_version=init_version, sanity_check=False)
コード例 #2
0
def upgrade(migrate_engine):
    raise exception.MigrationMovedFailure(extension='oauth1')
コード例 #3
0
def upgrade(migrate_engine):
    raise exception.MigrationMovedFailure(extension='endpoint_filter')