Deny to migrate to lower schema version
Deny migrating to lower version and remove downgrades testing relying on http://specs.openstack.org/openstack/openstack-specs/specs/no-downward-sql-migration.html Change-Id: I72421259deb9f28501b9d5ca4b9ccc43a8da7831
This commit is contained in:
parent
42b1347b3b
commit
dd34e7fb68
|
@ -1035,6 +1035,9 @@ def sync_point_update_input_data(context, entity_id,
|
|||
|
||||
def db_sync(engine, version=None):
|
||||
"""Migrate the database to `version` or the most recent version."""
|
||||
if version is not None and int(version) < db_version(engine):
|
||||
raise exception.Error(_("Cannot migrate to lower schema version."))
|
||||
|
||||
return migration.db_sync(engine, version=version)
|
||||
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ class HeatMigrationsCheckers(test_migrations.WalkVersionsMixin,
|
|||
common.FakeLogMixin):
|
||||
"""Test sqlalchemy-migrate migrations."""
|
||||
|
||||
snake_walk = True
|
||||
downgrade = True
|
||||
snake_walk = False
|
||||
downgrade = False
|
||||
|
||||
@property
|
||||
def INIT_VERSION(self):
|
||||
|
|
Loading…
Reference in New Issue