From 2d3bb55db4e269a7609414190652d0cb94dc6c2f Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Thu, 16 Apr 2026 07:59:49 -0500 Subject: [PATCH] Fix startup crash on existing DB: defer group_id index to migration The CREATE INDEX on schedules(group_id) in schema.sql ran before the phase4 migration added the group_id column, crashing on existing databases. Move the index creation to the migration which already handles it. Co-Authored-By: Claude Opus 4.6 --- server/db/schema.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/db/schema.sql b/server/db/schema.sql index b8c4050..38c7a5a 100644 --- a/server/db/schema.sql +++ b/server/db/schema.sql @@ -217,7 +217,7 @@ CREATE TABLE IF NOT EXISTS schedules ( ); CREATE INDEX IF NOT EXISTS idx_schedules_device ON schedules(device_id, enabled); -CREATE INDEX IF NOT EXISTS idx_schedules_group ON schedules(group_id, enabled); +-- Note: idx_schedules_group is created by the phase4 migration which rebuilds the table -- ===================== VIDEO WALLS =====================