ALTER TABLE calendar_events
  ADD COLUMN IF NOT EXISTS due_date DATE NULL AFTER end_at,
  ADD COLUMN IF NOT EXISTS manday INT UNSIGNED NOT NULL DEFAULT 0 AFTER due_date;

CREATE INDEX IF NOT EXISTS idx_calendar_events_due_date
  ON calendar_events (user_id, due_date);
