fix(build): allow fallback select without link_clicks and ensure unique constraint in creative_pipeline
This commit is contained in:
@@ -48,6 +48,15 @@ create unique index if not exists creative_pipeline_tenant_ref_idx
|
||||
on public.creative_pipeline (tenant_id, external_ref)
|
||||
where external_ref is not null;
|
||||
|
||||
do $$ begin
|
||||
if not exists (
|
||||
select 1 from pg_constraint where conname = 'creative_pipeline_tenant_ref_uniq'
|
||||
) then
|
||||
alter table public.creative_pipeline
|
||||
add constraint creative_pipeline_tenant_ref_uniq unique (tenant_id, external_ref);
|
||||
end if;
|
||||
end $$;
|
||||
|
||||
create index if not exists creative_pipeline_tenant_month_idx
|
||||
on public.creative_pipeline (tenant_id, month, status);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user