-- Migration 132: Quiet hours for notifications (v0.10.5 F553)
-- When enabled, no push/WebSocket delivery during the configured time window

ALTER TABLE notification_preferences
ADD COLUMN IF NOT EXISTS quiet_hours_enabled BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN IF NOT EXISTS quiet_hours_start TIME,  -- e.g. 22:00
ADD COLUMN IF NOT EXISTS quiet_hours_end TIME;    -- e.g. 08:00

-- Start/end are only meaningful when enabled
COMMENT ON COLUMN notification_preferences.quiet_hours_enabled IS 'If true, suppress push and real-time delivery during quiet hours';
COMMENT ON COLUMN notification_preferences.quiet_hours_start IS 'Quiet hours start (e.g. 22:00 for 10pm)';
COMMENT ON COLUMN notification_preferences.quiet_hours_end IS 'Quiet hours end (e.g. 08:00 for 8am); overnight range supported';
