Skip to content

Commit

Permalink
Merge "Auto-detect max SQL migration"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jan 16, 2013
2 parents a96ab06 + 52da32c commit 55c76ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_sql_upgrade.py
Expand Up @@ -53,6 +53,9 @@ def setUp(self):
self.schema = versioning_api.ControlledSchema.create(self.engine,
self.repo_path, 0)

# auto-detect the highest available schema version in the migrate_repo
self.max_version = self.schema.repository.version().version

def tearDown(self):
super(SqlUpgradeTests, self).tearDown()

Expand Down Expand Up @@ -270,7 +273,7 @@ def insert_dict(self, session, table_name, d):
', '.join("'%s'" % v for v in d.values())))

def test_downgrade_to_0(self):
self.upgrade(13)
self.upgrade(self.max_version)
self.downgrade(0)
for table_name in ["user", "token", "role", "user_tenant_membership",
"metadata"]:
Expand Down

0 comments on commit 55c76ef

Please sign in to comment.