This commit is contained in:
callebtc 2022-11-30 16:24:13 +01:00 committed by dni ⚡
parent f8647aa5d5
commit 33eb460d5c
27 changed files with 5495 additions and 281 deletions

View file

@ -128,6 +128,10 @@ def migrate_db(file: str, schema: str, exclude_tables: List[str] = []):
for table in tables:
tableName = table[0]
print(f"Migrating table {tableName}")
# hard coded skip for dbversions (already produced during startup)
if tableName == "dbversions":
continue
if tableName in exclude_tables:
continue
@ -151,7 +155,7 @@ def build_insert_query(schema, tableName, columns):
def to_column_type(columnType):
if columnType == "TIMESTAMP":
return "to_timestamp(%s)"
if columnType == "BOOLEAN":
if columnType in ["BOOLEAN", "BOOL"]:
return "%s::boolean"
return "%s"