uptime-kuma/release/convertmonitor.py
knoflook 80334f05f3
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
chore: publish 1.0.0+latest release
2024-11-14 13:42:48 +01:00

22 lines
634 B
Python
Executable File

#!/usr/bin/python3
og = open("original.sql", "r")
new = open("ported.sql", "w")
for line in og:
newline = line
if line.startswith("INSERT INTO monitor VALUES"):
newarr = line[27:-3].split(",")
if len(newarr) == 77:
kafka_producer_ssl_and_topic = ["0", "0"]
arr = newarr[:66] + kafka_producer_ssl_and_topic + newarr[66:75] + ["'keyword'", "NULL", "NULL", "'2c'", "NULL", "0", "'{}'"]
newline = "INSERT INTO monitor VALUES(" + ",".join(arr) + ");\n"
else:
newline = "--" + line
else:
pass
new.writelines(newline)
og.close()
new.close()