From 642dac165fb1649e01e8370acbc2b709299166c6 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 30 Oct 2020 10:27:57 +0000 Subject: [PATCH] Deprecate the 'oslo_db.sqlalchemy.migration_cli' module This API allowed users to abstract the differences between sqlalchemy-migrate and alembic. However, no one is using it for that and its continued existence necessitates continued support for sqlalchemy-migrate. Deprecate it now and encourage the odd user to switch to alembic directly. Change-Id: Ia5979369f23b38a2c7307f4112651a8bedb45c01 Signed-off-by: Stephen Finucane --- oslo_db/sqlalchemy/migration_cli/manager.py | 7 +++++++ .../deprecate-sqlalchemy-migrate-6f899935615d6984.yaml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/oslo_db/sqlalchemy/migration_cli/manager.py b/oslo_db/sqlalchemy/migration_cli/manager.py index 42683310..812d4bcc 100644 --- a/oslo_db/sqlalchemy/migration_cli/manager.py +++ b/oslo_db/sqlalchemy/migration_cli/manager.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from debtcollector import removals import sqlalchemy from stevedore import enabled @@ -24,6 +25,12 @@ def check_plugin_enabled(ext): return ext.obj.enabled +@removals.remove( + message='Support for sqlalchemy-migrate and with it the migration manager ' + 'is deprecated for removal; consider migrating to and using alembic ' + 'directly', + version='8.3.0' +) class MigrationManager(object): def __init__(self, migration_config, engine=None): diff --git a/releasenotes/notes/deprecate-sqlalchemy-migrate-6f899935615d6984.yaml b/releasenotes/notes/deprecate-sqlalchemy-migrate-6f899935615d6984.yaml index bcb82525..c1c7fa7e 100644 --- a/releasenotes/notes/deprecate-sqlalchemy-migrate-6f899935615d6984.yaml +++ b/releasenotes/notes/deprecate-sqlalchemy-migrate-6f899935615d6984.yaml @@ -6,3 +6,9 @@ deprecations: development and has been effectively replaced by ``alembic``. Users of this module should consider switching to ``alembic`` or, if necessary, using ``sqlalchemy-migrate`` directly. + - | + The ``oslo_db.sqlalchemy.migration_cli`` module is deprecated for removal. + It was intended to provide an abstraction layer over different migration + backends - specifically ``sqlalchemy-migrate`` and ``alembic`` - however, + takeup has been limited and its expected that users will use ``alembic`` + directly nowadays.