mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 01:40:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8 lines
464 B
SQL
8 lines
464 B
SQL
|
|
-- Add target_month (YYYY-MM-01 format) and completed_at to payables
|
|
ALTER TABLE public.payables ADD COLUMN target_month DATE DEFAULT date_trunc('month', CURRENT_DATE)::date;
|
|
ALTER TABLE public.payables ADD COLUMN completed_at TIMESTAMP WITH TIME ZONE;
|
|
|
|
-- Update existing payables to have target_month based on due_date or created_at
|
|
UPDATE public.payables SET target_month = COALESCE(date_trunc('month', due_date)::date, date_trunc('month', created_at)::date);
|