Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Add timezone column to scheduled_actions
-- Purpose: schedule weekly-report sends at 9am LOCAL time instead of 9am UTC
-- (currently the middle of the night in the US). See chat#1881 item 3c.

-- Change: add optional IANA timezone column with default NULL (NULL = UTC).
ALTER TABLE public.scheduled_actions
ADD COLUMN IF NOT EXISTS timezone text DEFAULT NULL;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Invalid timezone values can be persisted and reach timezone-aware next_run derivation once API wiring lands, producing errors or incorrect scheduling. Consider enforcing the documented IANA-ID contract at the database boundary (or add a validated timezone domain/function) rather than accepting arbitrary text.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At supabase/migrations/20260722000000_add_timezone_to_scheduled_actions.sql, line 7:

<comment>Invalid timezone values can be persisted and reach timezone-aware `next_run` derivation once API wiring lands, producing errors or incorrect scheduling. Consider enforcing the documented IANA-ID contract at the database boundary (or add a validated timezone domain/function) rather than accepting arbitrary text.</comment>

<file context>
@@ -0,0 +1,10 @@
+
+-- Change: add optional IANA timezone column with default NULL (NULL = UTC).
+ALTER TABLE public.scheduled_actions
+ADD COLUMN IF NOT EXISTS timezone text DEFAULT NULL;
+
+COMMENT ON COLUMN public.scheduled_actions.timezone IS
</file context>


COMMENT ON COLUMN public.scheduled_actions.timezone IS
'IANA timezone id (e.g. America/New_York) the schedule is interpreted in. NULL = UTC.';