Do not call AlembicMigrationManager.init_tables() for now.

sqlalchemy-migrate will do this for us.
This commit is contained in:
Berker Peksag 2014-10-02 20:16:46 +03:00
parent b36c84e68a
commit 2ace351bed

View File

@ -63,14 +63,16 @@ class AlembicMigrationManager(object):
Base.metadata.create_all(self.session.bind) Base.metadata.create_all(self.session.bind)
# load the Alembic configuration and generate the # load the Alembic configuration and generate the
# version table, "stamping" it with the most recent rev: # version table, "stamping" it with the most recent rev:
# XXX: we need to find a better way to detect current installations
# using sqlalchemy-migrate because we don't have to create all table
# for them
command.stamp(self.alembic_cfg, 'head') command.stamp(self.alembic_cfg, 'head')
def init_or_migrate(self, version=None): def init_or_migrate(self, version=None):
if self.get_current_revision() is None: # XXX: we need to call this method when we ditch
log.info('Initializing tables and stamping it with ' # sqlalchemy-migrate entirely
'the most recent migration...') # if self.get_current_revision() is None:
self.init_tables() # self.init_tables()
else:
self.upgrade(version) self.upgrade(version)