Editable targets vs actual, pipeline review-only with client reject notes, and published pieces opening from the calendar day. Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
544 B
SQL
17 lines
544 B
SQL
-- Monthly objectives: budget (ppto) + consecution targets
|
|
-- Idempotent.
|
|
|
|
alter table public.targets
|
|
add column if not exists spend_target numeric;
|
|
|
|
alter table public.targets
|
|
add column if not exists spend_actual numeric;
|
|
|
|
comment on column public.targets.spend_target is
|
|
'Presupuesto ads objetivo del mes (ppto)';
|
|
comment on column public.targets.spend_actual is
|
|
'Gasto ads real del mes (opcional; si null se calcula de ad_daily)';
|
|
|
|
create unique index if not exists targets_tenant_month_uidx
|
|
on public.targets (tenant_id, month);
|