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 <noreply@anthropic.com>
This commit is contained in:
ScreenTinker 2026-04-16 07:59:49 -05:00
parent 52dd44a3e8
commit 2d3bb55db4

View file

@ -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 =====================