-- Per-user reminder send times (t-paliad-048).
--
-- Background: the hourly ReminderService used to send mail whenever the
-- ticker found a matching due_date — m got reminders at 02:28. We now gate
-- delivery to a user-chosen hour-of-day in the user's local timezone.
--
-- Three knobs per user:
--   * reminder_morning_time  — when to send overdue / tomorrow / weekly
--   * reminder_evening_time  — when to send the new "due-today, still pending"
--                              evening sweep
--   * reminder_timezone      — IANA timezone the two times are interpreted in
--
-- Defaults target the HLC-Munich audience; existing rows pick them up via
-- the column DEFAULT, so no explicit backfill is needed.

ALTER TABLE paliad.users
    ADD COLUMN IF NOT EXISTS reminder_morning_time TIME NOT NULL DEFAULT '09:00:00',
    ADD COLUMN IF NOT EXISTS reminder_evening_time TIME NOT NULL DEFAULT '16:00:00',
    ADD COLUMN IF NOT EXISTS reminder_timezone     TEXT NOT NULL DEFAULT 'Europe/Berlin';
