Merge "Offline migration support for postgresql"

This commit is contained in:
Zuul 2018-02-10 21:15:25 +00:00 committed by Gerrit Code Review
commit 262e61a02e
1 changed files with 7 additions and 0 deletions

View File

@ -141,6 +141,13 @@ class DbCommands(object):
@args('--version', metavar='<version>', help='Database version')
def sync(self, version=None):
engine = db_api.get_engine().engine
if engine.name == 'postgresql':
if version is None:
version = db_migration.LATEST_REVISION
self._sync(version)
return
curr_heads = alembic_migrations.get_current_alembic_heads()
contract = alembic_migrations.get_alembic_branch_head(
db_migration.CONTRACT_BRANCH)