Start using alembic

Change-Id: I7c5636155ef68332d6c94b02efed012254e34e39
This commit is contained in:
James E. Blair 2017-11-27 11:18:36 -08:00
parent 49ab7d39e9
commit 9919a62912
1 changed files with 2 additions and 2 deletions

View File

@ -560,7 +560,7 @@ class Database(object):
self.search = search self.search = search
self.engine = create_engine(self.dburi) self.engine = create_engine(self.dburi)
metadata.create_all(self.engine) metadata.create_all(self.engine)
#self.migrate(app) self.migrate(app)
# If we want the objects returned from query() to be usable # If we want the objects returned from query() to be usable
# outside of the session, we need to expunge them from the session, # outside of the session, we need to expunge them from the session,
# and since the DatabaseSession always calls commit() on the session # and since the DatabaseSession always calls commit() on the session
@ -590,7 +590,7 @@ class Database(object):
if current_rev is None and has_table: if current_rev is None and has_table:
self.log.debug('Stamping database as initial revision') self.log.debug('Stamping database as initial revision')
alembic.command.stamp(config, "44402069e137") alembic.command.stamp(config, "183755ac91df")
alembic.command.upgrade(config, 'head') alembic.command.upgrade(config, 'head')
class DatabaseSession(object): class DatabaseSession(object):