Fix for current clickhouse version

This commit is contained in:
M1ha 2019-02-15 15:43:59 +05:00
parent fc100fb066
commit e436ae977b

View File

@ -139,7 +139,9 @@ class MigrationHistory(ClickHouseModel):
return set(obj.module_name for obj in qs) return set(obj.module_name for obj in qs)
except ServerError as ex: except ServerError as ex:
# Database doesn't exist or table doesn't exist # Database doesn't exist or table doesn't exist
if ex.code in {81, 60}: # I added string check, when code parsing broke in infi.clickouse_orm
# See https://github.com/Infinidat/infi.clickhouse_orm/issues/108
if ex.code in {81, 60} or 'Code: 60' in ex.message or 'Code: 81,' in ex.message:
return set() return set()
raise ex raise ex
except DatabaseException as ex: except DatabaseException as ex: