def upgrade(engine): schema = ControlledSchema(engine, self.repo_path) changeset = schema.changeset(None) for version, change in changeset: log.msg('migrating schema version %s -> %d' % (version, version + 1)) schema.runchange(version, change, 1)
def upgrade(engine): schema = ControlledSchema(engine, self.repo_path) changeset = schema.changeset(None) with sautils.withoutSqliteForeignKeys(engine): for version, change in changeset: log.msg('migrating schema version %s -> %d' % (version, version + 1)) schema.runchange(version, change, 1)
def run_batch(host, scripts, **kw): engine = kw['engine'] previous = "" schema = None for repo, ver, script, _ in scripts: if repo != previous: schema = ControlledSchema(engine, repo) previous = repo schema.runchange(ver, script, step=1)