From 1af9bc0f7eba5bacdcb55ecad9488794dad911d0 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 17 Apr 2026 22:39:52 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20events=20Migration=20PRAGMA=20table=5Fin?= =?UTF-8?q?fo=20Syntax=20(pragma=5Ftable=5Finfo()=20nicht=20unterst=C3=BCt?= =?UTF-8?q?zt)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/database.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/database.py b/backend/database.py index 6cd887f..d1ede93 100644 --- a/backend/database.py +++ b/backend/database.py @@ -657,10 +657,8 @@ def _migrate(conn_factory): logger.info("Migration: dog_shares Tabelle bereit.") # Events: user_id NOT NULL Constraint entfernen (für Scheduler-Imports ohne User) - row = conn.execute( - "SELECT notnull FROM pragma_table_info('events') WHERE name='user_id'" - ).fetchone() - if row and row[0] == 1: + _ev_cols = {r[1]: r[3] for r in conn.execute("PRAGMA table_info(events)").fetchall()} + if _ev_cols.get("user_id") == 1: conn.executescript(""" CREATE TABLE IF NOT EXISTS events_new ( id INTEGER PRIMARY KEY AUTOINCREMENT,