diff --git a/lib/ads/formats.ts b/lib/ads/formats.ts index 38593b4b..16f92491 100644 --- a/lib/ads/formats.ts +++ b/lib/ads/formats.ts @@ -23,6 +23,7 @@ export const PUBLISHER_FORMAT_IDS: AdFormatId[] = [ "banner_300x250", "banner_728x90", "banner_320x50", + "text_link", ]; export function formatSpec(id: AdFormatId) { diff --git a/supabase/migrations/20260717130000_ad_slot_text_link_format.sql b/supabase/migrations/20260717130000_ad_slot_text_link_format.sql new file mode 100644 index 00000000..3ac77360 --- /dev/null +++ b/supabase/migrations/20260717130000_ad_slot_text_link_format.sql @@ -0,0 +1,16 @@ +-- Allow the native text-link ad to serve on publisher slots. +-- +-- ad_slots.formats gates which sizes serveAd() will fill for a slot, and its +-- original default predates the text_link format: +-- default array['banner_300x250','banner_728x90','banner_320x50'] +-- So a publisher who copies the new text-link embed would get nothing back. +-- Widen the default for new slots and backfill existing ones so their +-- text-link embed actually fills. + +alter table public.ad_slots + alter column formats + set default array['banner_300x250', 'banner_728x90', 'banner_320x50', 'text_link']; + +update public.ad_slots + set formats = array_append(formats, 'text_link') + where not ('text_link' = any (formats));