Link pipeline creatives to RRSS calendar pieces with pick-or-create UI.

Agency can choose a scheduled calendar post to prefill title, copy, pillar and date, or create/edit one in the calendar while adding it to the pipeline.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-10-06 18:01:11 +02:00
parent 12ecde1b3b
commit c2bbbfcd06
6 changed files with 884 additions and 56 deletions

View File

@@ -0,0 +1,12 @@
-- Link pipeline creatives to RRSS calendar pieces (documents content.pieces[].id).
-- Idempotent.
alter table public.creative_pipeline
add column if not exists calendar_piece_id text;
create index if not exists creative_pipeline_calendar_piece_idx
on public.creative_pipeline (tenant_id, calendar_piece_id)
where calendar_piece_id is not null;
comment on column public.creative_pipeline.calendar_piece_id is
'Stable id of the RRSS calendar piece (documents type=calendar → pieces[].id). Agency links pipeline ↔ editorial plan.';