fix formatted string

This commit is contained in:
Paul 2024-07-14 11:18:40 +02:00
parent 69a8fbe7d8
commit 6189ceb4ac

View File

@ -55,12 +55,13 @@ def dump(dumpfile=DUMPFILE):
try:
with open(dumpfile, "r") as f:
a = json.load(f)
for database,values in a.items():
for database, values in a.items():
print(f"--- database {database} ---")
print("{};\n".format(values["ddl"]))
for table,c in values["tables"].items():
create_database = values["ddl"]
print(f"{create_database};\n")
for table, create_table in values["tables"].items():
print(f"-- table {database}.{table} --")
print(f"{c};\n")
print(f"{create_table};\n")
except FileNotFoundError as e:
print(e)
print("-- to re-create replicas, run 'clickhouse-client --multiquery < generated_file.sql' on new replica server")