utils: Deprecate sqlalchemy-migrate-related functions

These are using private APIs of SQLAlchemy but, more importantly, are
not necessary in an alembic-only world. Mark them deprecated for
removal.

Change-Id: I6efb6e1d35542cd8df922c86e134fe1e0b8c2e52
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2021-07-16 13:19:41 +01:00
parent 40bce5a2ba
commit da002a82f1

View File

@ -25,6 +25,7 @@ import re
from alembic.migration import MigrationContext from alembic.migration import MigrationContext
from alembic.operations import Operations from alembic.operations import Operations
import debtcollector.removals
from oslo_utils import timeutils from oslo_utils import timeutils
import sqlalchemy import sqlalchemy
from sqlalchemy import Boolean from sqlalchemy import Boolean
@ -544,6 +545,12 @@ def _restore_indexes_on_deleted_columns(engine, table_name, indexes):
new_index.create(engine) new_index.create(engine)
@debtcollector.removals.remove(
message='This API is intended for use with sqlalchemy-migrate, support '
'for which is deprecated for removal; it will be removed in a future '
'release',
version='10.1.0',
)
def change_deleted_column_type_to_boolean(engine, table_name, def change_deleted_column_type_to_boolean(engine, table_name,
**col_name_col_instance): **col_name_col_instance):
if engine.name == "sqlite": if engine.name == "sqlite":
@ -617,6 +624,12 @@ def _change_deleted_column_type_to_boolean_sqlite(engine, table_name,
execute() execute()
@debtcollector.removals.remove(
message='This API is intended for use with sqlalchemy-migrate, support '
'for which is deprecated for removal; it will be removed in a future '
'release',
version='10.1.0',
)
def change_deleted_column_type_to_id_type(engine, table_name, def change_deleted_column_type_to_id_type(engine, table_name,
**col_name_col_instance): **col_name_col_instance):
if engine.name == "sqlite": if engine.name == "sqlite":