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:
Tetiana Lashchova 2015-04-17 16:32:52 +03:00
parent 42b1347b3b
commit dd34e7fb68
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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):