cinder/releasenotes/notes/switch-to-alembic-2bbe27749fde70ff.yaml
Stephen Finucane ee771bbdbc db: Integrate alembic
Start the move to alembic for real by integrating it into the 'db sync'
command flow. sqlalchemy-migrate is not removed entirely. Not yet
anyway. Instead, we will apply all sqlalchemy-migrate migrations up to
the final '140_create_project_default_volume_type' migration, after
which we will switch over to alembic. In a future release we can remove
the sqlalchemy-migrate migrations and rely entirely on alembic.

Change-Id: Id30929de443d5f7e3923d1061a9f7bbe8b949d5a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-08-27 15:13:21 +01:00

26 lines
1.3 KiB
YAML

---
upgrade:
- |
The database migration engine has changed from `sqlalchemy-migrate`__ to
`alembic`__. For most deployments, this should have minimal to no impact
and the switch should be mostly transparent. The main user-facing impact is
the change in schema versioning. While sqlalchemy-migrate used a linear,
integer-based versioning scheme, which required placeholder migrations to
allow for potential migration backports, alembic uses a distributed version
control-like schema where a migration's ancestor is encoded in the file and
branches are possible. The alembic migration files therefore use a
arbitrary UUID-like naming scheme and the ``cinder-manage db sync`` command
now expects such an version when manually specifying the version that should
be applied. For example::
$ cinder-manage db sync 921e1a36b076
It is no longer possible to specify an sqlalchemy-migrate-based version.
When the ``cinder-manage db sync`` command is run, all remaining
sqlalchemy-migrate-based migrations will be automatically applied.
Attempting to specify an sqlalchemy-migrate-based version will result in an
error.
.. __: https://sqlalchemy-migrate.readthedocs.io/en/latest/
.. __: https://alembic.sqlalchemy.org/en/latest/