Deprecate 'oslo_db.sqlalchemy.migration' module

This module hasn't been touched with years and 'sqlalchemy-migrate' is
effectively abandoned. It's time to drop support for this an encourage
the laggards to switch to alembic and use it directly.

Change-Id: I59335b4f318bae2e29ab139cdea089a4d6e14305
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2020-10-30 10:12:13 +00:00
parent f62ddb1524
commit fc85587523
2 changed files with 18 additions and 0 deletions

View File

@ -41,6 +41,7 @@
import os
from debtcollector import removals
from migrate import exceptions as versioning_exceptions
from migrate.versioning import api as versioning_api
from migrate.versioning.repository import Repository
@ -50,6 +51,13 @@ from oslo_db._i18n import _
from oslo_db import exception
_removed_msg = (
'sqlalchemy-migrate support in oslo_db is deprecated; consider '
'migrating to alembic'
)
@removals.remove(message=_removed_msg, version='8.3.0')
def db_sync(engine, abs_path, version=None, init_version=0, sanity_check=True):
"""Upgrade or downgrade a database.
@ -116,6 +124,7 @@ def _db_schema_sanity_check(engine):
) % ','.join(table_names))
@removals.remove(message=_removed_msg, version='8.3.0')
def db_version(engine, abs_path, init_version):
"""Show the current version of the repository.
@ -141,6 +150,7 @@ def db_version(engine, abs_path, init_version):
"manually."))
@removals.remove(message=_removed_msg, version='8.3.0')
def db_version_control(engine, abs_path, version=None):
"""Mark a database as under this repository's version control.

View File

@ -0,0 +1,8 @@
---
deprecations:
- |
The ``oslo_db.sqlalchemy.migration`` module is deprecated for removal.
It only supports ``sqlalchemy-migrate``, which is no longer under active
development and has been effectively replaced by ``alembic``. Users of
this module should consider switching to ``alembic`` or, if necessary,
using ``sqlalchemy-migrate`` directly.