Skip to content

Commit 529efc1

Browse files
author
jacquesbach
committed
Undo force_rebuild daily_stats table
1 parent aa7ae18 commit 529efc1

2 files changed

Lines changed: 1 addition & 19 deletions

File tree

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
init_db()
2626

2727
# 🔥 EINMAL ausführen, danach wieder auskommentieren!
28-
force_rebuild_daily_stats()
28+
# force_rebuild_daily_stats()
2929

3030
self_heal_daily_stats()
3131

database.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,6 @@ def init_db():
5252
kwh_dc_total REAL
5353
)
5454
''')
55-
56-
# 2. AUTOMATISCHES UPGRADE für neue Spalten
57-
c.execute("PRAGMA table_info(daily_stats)")
58-
existing_columns = [col[1] for col in c.fetchall()]
59-
60-
if "daylight_duration" not in existing_columns:
61-
print("Migriere Datenbank: Spalte daylight_duration wird hinzugefügt...")
62-
c.execute("ALTER TABLE daily_stats ADD COLUMN daylight_duration REAL")
63-
64-
if "sunshine_duration" not in existing_columns:
65-
print("Migriere Datenbank: Spalte sunshine_duration wird hinzugefügt...")
66-
c.execute("ALTER TABLE daily_stats ADD COLUMN sunshine_duration REAL")
67-
68-
# 3. Restliche Spalten (max_w_panel1, etc.) sicherstellen
69-
# Falls du die auch noch nicht hast, kannst du das Muster einfach fortsetzen:
70-
for col in ["max_w_panel1", "max_w_panel2", "kwh_panel1", "kwh_panel2", "kwh_dc_total"]:
71-
if col not in existing_columns:
72-
c.execute(f"ALTER TABLE daily_stats ADD COLUMN {col} REAL")
7355

7456
# 3. Globale Gesamt-Statistiken
7557
c.execute('''

0 commit comments

Comments
 (0)