-- Migration: add home_page_hero_slides table for CMS-managed hero slider
-- IMPORTANT: id must be character varying (not serial) — Payload generates string IDs
CREATE TABLE IF NOT EXISTS home_page_hero_slides (
  _order integer NOT NULL,
  _parent_id integer NOT NULL REFERENCES home_page(id) ON DELETE CASCADE,
  id character varying NOT NULL,
  background_image_id integer REFERENCES media(id) ON DELETE SET NULL,
  background_image_url character varying,
  type character varying,
  title character varying,
  subtitle character varying,
  cta_label character varying,
  cta_href character varying,
  updated_at timestamp with time zone DEFAULT now(),
  created_at timestamp with time zone DEFAULT now(),
  CONSTRAINT home_page_hero_slides_pkey PRIMARY KEY (id)
);
CREATE INDEX home_page_hero_slides_order_idx ON home_page_hero_slides (_order);
CREATE INDEX home_page_hero_slides_parent_id_idx ON home_page_hero_slides (_parent_id);
