def _migrate_up(self, config, engine, revision, with_data=False):
    if with_data:
        data = None
        pre_upgrade = getattr(self, ('_pre_upgrade_%s' % revision), None)
        if pre_upgrade:
            data = pre_upgrade(engine)
    alembic_command.upgrade(config, revision)
    if with_data:
        check = getattr(self, ('_check_%s' % revision), None)
        if check:
            check(engine, data)
def _migrate_up(self, config, engine, revision, with_data=False):
    if with_data:
        data = None
        pre_upgrade = getattr(self, ('_pre_upgrade_%s' % revision), None)
        if pre_upgrade:
            data = pre_upgrade(engine)
    alembic_command.upgrade(config, revision)
    if with_data:
        check = getattr(self, ('_check_%s' % revision), None)
        if check:
            check(engine, data)