Skip to content

Commit 7f7948c

Browse files
Fixed comment is DB schemas causing errors
1 parent 214aa09 commit 7f7948c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

scripts/cwa_db.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ def get_cwa_default_settings(self):
7979

8080
settings_lines = []
8181
for line in settings_table.split('\n'):
82-
if line[:4] == " ":
83-
settings_lines.append(line.strip())
82+
stripped = line.strip()
83+
# Skip comment lines and empty lines
84+
if line[:4] == " " and not stripped.startswith('--') and stripped:
85+
settings_lines.append(stripped)
8486

8587
default_settings = {}
8688
for line in settings_lines:
@@ -128,6 +130,9 @@ def add_missing_setting(self, setting) -> bool:
128130
if match:
129131
try:
130132
command = line.replace('\n', '').strip()
133+
# Skip SQL comments
134+
if command.startswith('--') or not command:
135+
continue
131136
command = command.replace(',', ';')
132137
with open('/config/.cwa_db_debug', 'a') as f:
133138
f.write(command)

0 commit comments

Comments
 (0)