Table: promo_bands
Operator-authored, full-width promo strips shown between pages of the browse feed. A band’s cards are ordinary featured_items rows carrying the band’s id, so curation, ordering and visibility have one home (ADR 0065). The band’s scope sets the audience for the whole band; the cards’ own scope isn’t consulted. An empty or disabled band renders nothing.
Connected to
Section titled “Connected to”Referenced by:
featured_items: columnband_id
Columns
Section titled “Columns”| Column | Type | Nullable | Notes |
|---|---|---|---|
id | uuid | no | Default gen_random_uuid() |
title | text | no | Default ''::text |
blurb | text | no | Default ''::text |
cta_label | text | no | Default ''::text |
cta_url | text | no | Default ''::text |
enabled | boolean | no | Default false |
after_page | integer | no | Default 1. Where the band appears, counted in loaded feed pages: 1 places it after the first page. Page size is set by the client (the browse feed loads 36 posts per page), so this is a scroll position rather than a row count. |
scope | text | no | Default 'org'::text |
created_at | timestamp | no | Default now() |
updated_at | timestamp | no | Default now() |
created_by_user_ref | bigint | yes | - |
Constraints
Section titled “Constraints”CONSTRAINT promo_bands_after_page_check CHECK ((after_page >= 1))CONSTRAINT promo_bands_cta_pair_check CHECK ((((cta_label = ''::text) AND (cta_url = ''::text)) OR ((cta_label <> ''::text) AND (cta_url <> ''::text))))CONSTRAINT promo_bands_cta_url_check CHECK (((cta_url = ''::text) OR (cta_url ~ '^(https?://[^/]|/[^/])'::text)))CONSTRAINT promo_bands_scope_check CHECK ((scope = ANY (ARRAY['public'::text, 'org'::text])))
Full DDL
Section titled “Full DDL”This is the table’s CREATE TABLE statement. Constraints added with separate ALTER TABLE statements, including foreign-key ON DELETE rules, and indexes are defined elsewhere in the dump; see the complete app/schema.sql.
CREATE TABLE public.promo_bands ( id uuid DEFAULT gen_random_uuid() NOT NULL, title text DEFAULT ''::text NOT NULL, blurb text DEFAULT ''::text NOT NULL, cta_label text DEFAULT ''::text NOT NULL, cta_url text DEFAULT ''::text NOT NULL, enabled boolean DEFAULT false NOT NULL, after_page integer DEFAULT 1 NOT NULL, scope text DEFAULT 'org'::text NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, created_by_user_ref bigint, CONSTRAINT promo_bands_after_page_check CHECK ((after_page >= 1)), CONSTRAINT promo_bands_cta_pair_check CHECK ((((cta_label = ''::text) AND (cta_url = ''::text)) OR ((cta_label <> ''::text) AND (cta_url <> ''::text)))), CONSTRAINT promo_bands_cta_url_check CHECK (((cta_url = ''::text) OR (cta_url ~ '^(https?://[^/]|/[^/])'::text))), CONSTRAINT promo_bands_scope_check CHECK ((scope = ANY (ARRAY['public'::text, 'org'::text]))));See the schema overview for context.