-- Migration 0002: redirects plugin, locations fields, globals versioning, new pages
-- Extracted from 20260515_162527.ts — idempotent (ON_ERROR_STOP=0 on runner)

CREATE TYPE IF NOT EXISTS "public"."enum_redirects_to_type" AS ENUM('reference', 'custom');
CREATE TYPE IF NOT EXISTS "public"."enum_redirects_type" AS ENUM('301', '302');
CREATE TYPE IF NOT EXISTS "public"."enum_home_page_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum__home_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum_group_visits_page_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum__group_visits_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum_birthday_page_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum__birthday_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum_tickets_page_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum__tickets_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum_locations_page_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum__locations_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum_blog_index_page_status" AS ENUM('draft', 'published');
CREATE TYPE IF NOT EXISTS "public"."enum__blog_index_page_v_version_status" AS ENUM('draft', 'published');

CREATE TABLE IF NOT EXISTS "locations_hero_tips" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "id" varchar PRIMARY KEY NOT NULL,
  "text" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "locations_why_visit_items" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "id" varchar PRIMARY KEY NOT NULL,
  "title" varchar NOT NULL,
  "description" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "locations_review_videos" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "id" varchar PRIMARY KEY NOT NULL,
  "src" varchar NOT NULL,
  "poster" varchar,
  "label" varchar
);

CREATE TABLE IF NOT EXISTS "redirects" (
  "id" serial PRIMARY KEY NOT NULL,
  "from" varchar NOT NULL,
  "to_type" "enum_redirects_to_type" DEFAULT 'reference',
  "to_url" varchar,
  "type" "enum_redirects_type" NOT NULL,
  "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL
);

CREATE TABLE IF NOT EXISTS "redirects_rels" (
  "id" serial PRIMARY KEY NOT NULL,
  "order" integer,
  "parent_id" integer NOT NULL,
  "path" varchar NOT NULL,
  "pages_id" integer
);

CREATE TABLE IF NOT EXISTS "_home_page_v_version_why_parents_items" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "id" serial PRIMARY KEY NOT NULL,
  "title" varchar,
  "description" varchar,
  "_uuid" varchar
);

CREATE TABLE IF NOT EXISTS "_home_page_v_version_why_parents_side_gallery" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "id" serial PRIMARY KEY NOT NULL,
  "image_id" integer,
  "_uuid" varchar
);

CREATE TABLE IF NOT EXISTS "_home_page_v_version_gallery_images" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "id" serial PRIMARY KEY NOT NULL,
  "image_id" integer,
  "alt" varchar,
  "_uuid" varchar
);

CREATE TABLE IF NOT EXISTS "_home_page_v" (
  "id" serial PRIMARY KEY NOT NULL,
  "version_hero_title" varchar,
  "version_hero_subtitle" varchar,
  "version_hero_cta_label" varchar,
  "version_hero_cta_href" varchar,
  "version_hero_background_video" varchar,
  "version_hero_background_image_id" integer,
  "version_hero_foreground_overlay_id" integer,
  "version_hero_silhouette_overlay_id" integer,
  "version_page_hero_background_image_id" integer,
  "version_section_titles_locations" varchar,
  "version_section_titles_why_parents" varchar,
  "version_section_titles_birthday" varchar,
  "version_section_titles_gallery" varchar,
  "version_section_titles_reviews" varchar,
  "version_section_titles_news" varchar,
  "version_video_poster_id" integer,
  "version_video_src" varchar,
  "version_birthday_intro_text" varchar,
  "version_news_title" varchar,
  "version_news_subtitle" varchar,
  "version_news_limit" numeric DEFAULT 3,
  "version_map_embed_url" varchar,
  "version_map_address" varchar,
  "version_map_lat" numeric,
  "version_map_lng" numeric,
  "version_meta_title" varchar,
  "version_meta_description" varchar,
  "version_meta_image_id" integer,
  "version__status" "enum__home_page_v_version_status" DEFAULT 'draft',
  "version_updated_at" timestamp(3) with time zone,
  "version_created_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "latest" boolean,
  "autosave" boolean
);

CREATE TABLE IF NOT EXISTS "_group_visits_page_v_version_groups" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "id" serial PRIMARY KEY NOT NULL,
  "icon" varchar,
  "title" varchar,
  "description" varchar,
  "min_people" varchar,
  "discount" varchar,
  "_uuid" varchar
);

CREATE TABLE IF NOT EXISTS "_group_visits_page_v" (
  "id" serial PRIMARY KEY NOT NULL,
  "version_hero_title" varchar DEFAULT 'Групові відвідування',
  "version_hero_subtitle" varchar DEFAULT 'Спеціальні умови для організованих груп. Мінімум 10 осіб — максимум вражень.',
  "version_form_title" varchar DEFAULT 'Подати заявку на групове відвідування',
  "version_form_subtitle" varchar DEFAULT 'Вкажіть кількість учасників та бажану дату — менеджер зателефонує і погодить деталі.',
  "version_meta_title" varchar,
  "version_meta_description" varchar,
  "version_meta_image_id" integer,
  "version__status" "enum__group_visits_page_v_version_status" DEFAULT 'draft',
  "version_updated_at" timestamp(3) with time zone,
  "version_created_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "latest" boolean,
  "autosave" boolean
);

CREATE TABLE IF NOT EXISTS "_birthday_page_v" (
  "id" serial PRIMARY KEY NOT NULL,
  "version_hero_title" varchar DEFAULT 'Дні народження',
  "version_hero_subtitle" varchar DEFAULT 'Зробіть свято незабутнім! Оберіть пакет і наші менеджери зв''яжуться з вами для уточнення деталей.',
  "version_form_title" varchar DEFAULT 'Замовити святкування',
  "version_form_subtitle" varchar DEFAULT 'Залиште заявку і наш менеджер зв''яжеться з вами протягом 30 хвилин',
  "version_meta_title" varchar,
  "version_meta_description" varchar,
  "version_meta_image_id" integer,
  "version__status" "enum__birthday_page_v_version_status" DEFAULT 'draft',
  "version_updated_at" timestamp(3) with time zone,
  "version_created_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "latest" boolean,
  "autosave" boolean
);

CREATE TABLE IF NOT EXISTS "_tickets_page_v" (
  "id" serial PRIMARY KEY NOT NULL,
  "version_hero_title" varchar DEFAULT 'Купити квиток',
  "version_hero_subtitle" varchar DEFAULT 'Оберіть квиток та придбайте онлайн — без черги на касі',
  "version_section_title_birthday" varchar DEFAULT 'Дні народження',
  "version_section_title_groups" varchar DEFAULT 'Групові відвідування',
  "version_meta_title" varchar,
  "version_meta_description" varchar,
  "version_meta_image_id" integer,
  "version__status" "enum__tickets_page_v_version_status" DEFAULT 'draft',
  "version_updated_at" timestamp(3) with time zone,
  "version_created_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "latest" boolean,
  "autosave" boolean
);

CREATE TABLE IF NOT EXISTS "locations_page" (
  "id" serial PRIMARY KEY NOT NULL,
  "hero_title" varchar DEFAULT 'Локації',
  "hero_subtitle" varchar DEFAULT 'Неповторні зони розваг для всієї родини',
  "meta_title" varchar,
  "meta_description" varchar,
  "meta_image_id" integer,
  "_status" "enum_locations_page_status" DEFAULT 'draft',
  "updated_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone
);

CREATE TABLE IF NOT EXISTS "_locations_page_v" (
  "id" serial PRIMARY KEY NOT NULL,
  "version_hero_title" varchar DEFAULT 'Локації',
  "version_hero_subtitle" varchar DEFAULT 'Неповторні зони розваг для всієї родини',
  "version_meta_title" varchar,
  "version_meta_description" varchar,
  "version_meta_image_id" integer,
  "version__status" "enum__locations_page_v_version_status" DEFAULT 'draft',
  "version_updated_at" timestamp(3) with time zone,
  "version_created_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "latest" boolean,
  "autosave" boolean
);

CREATE TABLE IF NOT EXISTS "blog_index_page" (
  "id" serial PRIMARY KEY NOT NULL,
  "hero_title" varchar DEFAULT 'Блог',
  "hero_subtitle" varchar DEFAULT 'Новини, статті та корисна інформація від парку Шуміленд',
  "meta_title" varchar,
  "meta_description" varchar,
  "meta_image_id" integer,
  "_status" "enum_blog_index_page_status" DEFAULT 'draft',
  "updated_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone
);

CREATE TABLE IF NOT EXISTS "_blog_index_page_v" (
  "id" serial PRIMARY KEY NOT NULL,
  "version_hero_title" varchar DEFAULT 'Блог',
  "version_hero_subtitle" varchar DEFAULT 'Новини, статті та корисна інформація від парку Шуміленд',
  "version_meta_title" varchar,
  "version_meta_description" varchar,
  "version_meta_image_id" integer,
  "version__status" "enum__blog_index_page_v_version_status" DEFAULT 'draft',
  "version_updated_at" timestamp(3) with time zone,
  "version_created_at" timestamp(3) with time zone,
  "created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
  "latest" boolean,
  "autosave" boolean
);

ALTER TABLE "group_visits_page_groups" ALTER COLUMN "icon" DROP NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "title" DROP NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "description" DROP NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "min_people" DROP NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "discount" DROP NOT NULL;

ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "show_detail_page" boolean DEFAULT false;
ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "hero_background_id" integer;
ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "hero_stat" varchar;
ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "hero_stat_label" varchar;
ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "gallery_quote" varchar;
ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "why_visit_title" varchar;
ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "working_hours" varchar;
ALTER TABLE "locations" ADD COLUMN IF NOT EXISTS "combo_description" varchar;
ALTER TABLE "payload_locked_documents_rels" ADD COLUMN IF NOT EXISTS "redirects_id" integer;
ALTER TABLE "home_page" ADD COLUMN IF NOT EXISTS "_status" "enum_home_page_status" DEFAULT 'draft';
ALTER TABLE "group_visits_page" ADD COLUMN IF NOT EXISTS "_status" "enum_group_visits_page_status" DEFAULT 'draft';
ALTER TABLE "birthday_page" ADD COLUMN IF NOT EXISTS "_status" "enum_birthday_page_status" DEFAULT 'draft';
ALTER TABLE "tickets_page" ADD COLUMN IF NOT EXISTS "_status" "enum_tickets_page_status" DEFAULT 'draft';

ALTER TABLE "locations_hero_tips" ADD CONSTRAINT "locations_hero_tips_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."locations"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "locations_why_visit_items" ADD CONSTRAINT "locations_why_visit_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."locations"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "locations_review_videos" ADD CONSTRAINT "locations_review_videos_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."locations"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "redirects_rels" ADD CONSTRAINT "redirects_rels_parent_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."redirects"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "redirects_rels" ADD CONSTRAINT "redirects_rels_pages_fk" FOREIGN KEY ("pages_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "_home_page_v_version_why_parents_items" ADD CONSTRAINT "_home_page_v_version_why_parents_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_home_page_v"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "_home_page_v_version_why_parents_side_gallery" ADD CONSTRAINT "_home_page_v_version_why_parents_side_gallery_image_id_media_id_fk" FOREIGN KEY ("image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_home_page_v_version_why_parents_side_gallery" ADD CONSTRAINT "_home_page_v_version_why_parents_side_gallery_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_home_page_v"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "_home_page_v_version_gallery_images" ADD CONSTRAINT "_home_page_v_version_gallery_images_image_id_media_id_fk" FOREIGN KEY ("image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_home_page_v_version_gallery_images" ADD CONSTRAINT "_home_page_v_version_gallery_images_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_home_page_v"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "_home_page_v" ADD CONSTRAINT "_home_page_v_version_hero_background_image_id_media_id_fk" FOREIGN KEY ("version_hero_background_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_home_page_v" ADD CONSTRAINT "_home_page_v_version_hero_foreground_overlay_id_media_id_fk" FOREIGN KEY ("version_hero_foreground_overlay_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_home_page_v" ADD CONSTRAINT "_home_page_v_version_hero_silhouette_overlay_id_media_id_fk" FOREIGN KEY ("version_hero_silhouette_overlay_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_home_page_v" ADD CONSTRAINT "_home_page_v_version_page_hero_background_image_id_media_id_fk" FOREIGN KEY ("version_page_hero_background_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_home_page_v" ADD CONSTRAINT "_home_page_v_version_video_poster_id_media_id_fk" FOREIGN KEY ("version_video_poster_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_home_page_v" ADD CONSTRAINT "_home_page_v_version_meta_image_id_media_id_fk" FOREIGN KEY ("version_meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_group_visits_page_v_version_groups" ADD CONSTRAINT "_group_visits_page_v_version_groups_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_visits_page_v"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "_group_visits_page_v" ADD CONSTRAINT "_group_visits_page_v_version_meta_image_id_media_id_fk" FOREIGN KEY ("version_meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_birthday_page_v" ADD CONSTRAINT "_birthday_page_v_version_meta_image_id_media_id_fk" FOREIGN KEY ("version_meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_tickets_page_v" ADD CONSTRAINT "_tickets_page_v_version_meta_image_id_media_id_fk" FOREIGN KEY ("version_meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "locations_page" ADD CONSTRAINT "locations_page_meta_image_id_media_id_fk" FOREIGN KEY ("meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_locations_page_v" ADD CONSTRAINT "_locations_page_v_version_meta_image_id_media_id_fk" FOREIGN KEY ("version_meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "blog_index_page" ADD CONSTRAINT "blog_index_page_meta_image_id_media_id_fk" FOREIGN KEY ("meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "_blog_index_page_v" ADD CONSTRAINT "_blog_index_page_v_version_meta_image_id_media_id_fk" FOREIGN KEY ("version_meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "locations" ADD CONSTRAINT "locations_hero_background_id_media_id_fk" FOREIGN KEY ("hero_background_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
ALTER TABLE "payload_locked_documents_rels" ADD CONSTRAINT "payload_locked_documents_rels_redirects_fk" FOREIGN KEY ("redirects_id") REFERENCES "public"."redirects"("id") ON DELETE cascade ON UPDATE no action;

CREATE INDEX IF NOT EXISTS "locations_hero_tips_order_idx" ON "locations_hero_tips" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "locations_hero_tips_parent_id_idx" ON "locations_hero_tips" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "locations_why_visit_items_order_idx" ON "locations_why_visit_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "locations_why_visit_items_parent_id_idx" ON "locations_why_visit_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "locations_review_videos_order_idx" ON "locations_review_videos" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "locations_review_videos_parent_id_idx" ON "locations_review_videos" USING btree ("_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "redirects_from_idx" ON "redirects" USING btree ("from");
CREATE INDEX IF NOT EXISTS "redirects_updated_at_idx" ON "redirects" USING btree ("updated_at");
CREATE INDEX IF NOT EXISTS "redirects_created_at_idx" ON "redirects" USING btree ("created_at");
CREATE INDEX IF NOT EXISTS "redirects_rels_order_idx" ON "redirects_rels" USING btree ("order");
CREATE INDEX IF NOT EXISTS "redirects_rels_parent_idx" ON "redirects_rels" USING btree ("parent_id");
CREATE INDEX IF NOT EXISTS "redirects_rels_path_idx" ON "redirects_rels" USING btree ("path");
CREATE INDEX IF NOT EXISTS "redirects_rels_pages_id_idx" ON "redirects_rels" USING btree ("pages_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_why_parents_items_order_idx" ON "_home_page_v_version_why_parents_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_why_parents_items_parent_id_idx" ON "_home_page_v_version_why_parents_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_why_parents_side_gallery_order_idx" ON "_home_page_v_version_why_parents_side_gallery" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_why_parents_side_gallery_parent_id_idx" ON "_home_page_v_version_why_parents_side_gallery" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_why_parents_side_gallery_image_idx" ON "_home_page_v_version_why_parents_side_gallery" USING btree ("image_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_gallery_images_order_idx" ON "_home_page_v_version_gallery_images" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_gallery_images_parent_id_idx" ON "_home_page_v_version_gallery_images" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_gallery_images_image_idx" ON "_home_page_v_version_gallery_images" USING btree ("image_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_hero_version_hero_background_image_idx" ON "_home_page_v" USING btree ("version_hero_background_image_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_hero_version_hero_foreground_overla_idx" ON "_home_page_v" USING btree ("version_hero_foreground_overlay_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_hero_version_hero_silhouette_overla_idx" ON "_home_page_v" USING btree ("version_hero_silhouette_overlay_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_page_hero_version_page_hero_backgro_idx" ON "_home_page_v" USING btree ("version_page_hero_background_image_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_video_version_video_poster_idx" ON "_home_page_v" USING btree ("version_video_poster_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_meta_version_meta_image_idx" ON "_home_page_v" USING btree ("version_meta_image_id");
CREATE INDEX IF NOT EXISTS "_home_page_v_version_version__status_idx" ON "_home_page_v" USING btree ("version__status");
CREATE INDEX IF NOT EXISTS "_home_page_v_created_at_idx" ON "_home_page_v" USING btree ("created_at");
CREATE INDEX IF NOT EXISTS "_home_page_v_updated_at_idx" ON "_home_page_v" USING btree ("updated_at");
CREATE INDEX IF NOT EXISTS "_home_page_v_latest_idx" ON "_home_page_v" USING btree ("latest");
CREATE INDEX IF NOT EXISTS "_home_page_v_autosave_idx" ON "_home_page_v" USING btree ("autosave");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_version_groups_order_idx" ON "_group_visits_page_v_version_groups" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_version_groups_parent_id_idx" ON "_group_visits_page_v_version_groups" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_version_meta_version_meta_image_idx" ON "_group_visits_page_v" USING btree ("version_meta_image_id");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_version_version__status_idx" ON "_group_visits_page_v" USING btree ("version__status");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_created_at_idx" ON "_group_visits_page_v" USING btree ("created_at");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_updated_at_idx" ON "_group_visits_page_v" USING btree ("updated_at");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_latest_idx" ON "_group_visits_page_v" USING btree ("latest");
CREATE INDEX IF NOT EXISTS "_group_visits_page_v_autosave_idx" ON "_group_visits_page_v" USING btree ("autosave");
CREATE INDEX IF NOT EXISTS "_birthday_page_v_version_meta_version_meta_image_idx" ON "_birthday_page_v" USING btree ("version_meta_image_id");
CREATE INDEX IF NOT EXISTS "_birthday_page_v_version_version__status_idx" ON "_birthday_page_v" USING btree ("version__status");
CREATE INDEX IF NOT EXISTS "_birthday_page_v_created_at_idx" ON "_birthday_page_v" USING btree ("created_at");
CREATE INDEX IF NOT EXISTS "_birthday_page_v_updated_at_idx" ON "_birthday_page_v" USING btree ("updated_at");
CREATE INDEX IF NOT EXISTS "_birthday_page_v_latest_idx" ON "_birthday_page_v" USING btree ("latest");
CREATE INDEX IF NOT EXISTS "_birthday_page_v_autosave_idx" ON "_birthday_page_v" USING btree ("autosave");
CREATE INDEX IF NOT EXISTS "_tickets_page_v_version_meta_version_meta_image_idx" ON "_tickets_page_v" USING btree ("version_meta_image_id");
CREATE INDEX IF NOT EXISTS "_tickets_page_v_version_version__status_idx" ON "_tickets_page_v" USING btree ("version__status");
CREATE INDEX IF NOT EXISTS "_tickets_page_v_created_at_idx" ON "_tickets_page_v" USING btree ("created_at");
CREATE INDEX IF NOT EXISTS "_tickets_page_v_updated_at_idx" ON "_tickets_page_v" USING btree ("updated_at");
CREATE INDEX IF NOT EXISTS "_tickets_page_v_latest_idx" ON "_tickets_page_v" USING btree ("latest");
CREATE INDEX IF NOT EXISTS "_tickets_page_v_autosave_idx" ON "_tickets_page_v" USING btree ("autosave");
CREATE INDEX IF NOT EXISTS "locations_page_meta_meta_image_idx" ON "locations_page" USING btree ("meta_image_id");
CREATE INDEX IF NOT EXISTS "locations_page__status_idx" ON "locations_page" USING btree ("_status");
CREATE INDEX IF NOT EXISTS "_locations_page_v_version_meta_version_meta_image_idx" ON "_locations_page_v" USING btree ("version_meta_image_id");
CREATE INDEX IF NOT EXISTS "_locations_page_v_version_version__status_idx" ON "_locations_page_v" USING btree ("version__status");
CREATE INDEX IF NOT EXISTS "_locations_page_v_created_at_idx" ON "_locations_page_v" USING btree ("created_at");
CREATE INDEX IF NOT EXISTS "_locations_page_v_updated_at_idx" ON "_locations_page_v" USING btree ("updated_at");
CREATE INDEX IF NOT EXISTS "_locations_page_v_latest_idx" ON "_locations_page_v" USING btree ("latest");
CREATE INDEX IF NOT EXISTS "_locations_page_v_autosave_idx" ON "_locations_page_v" USING btree ("autosave");
CREATE INDEX IF NOT EXISTS "blog_index_page_meta_meta_image_idx" ON "blog_index_page" USING btree ("meta_image_id");
CREATE INDEX IF NOT EXISTS "blog_index_page__status_idx" ON "blog_index_page" USING btree ("_status");
CREATE INDEX IF NOT EXISTS "_blog_index_page_v_version_meta_version_meta_image_idx" ON "_blog_index_page_v" USING btree ("version_meta_image_id");
CREATE INDEX IF NOT EXISTS "_blog_index_page_v_version_version__status_idx" ON "_blog_index_page_v" USING btree ("version__status");
CREATE INDEX IF NOT EXISTS "_blog_index_page_v_created_at_idx" ON "_blog_index_page_v" USING btree ("created_at");
CREATE INDEX IF NOT EXISTS "_blog_index_page_v_updated_at_idx" ON "_blog_index_page_v" USING btree ("updated_at");
CREATE INDEX IF NOT EXISTS "_blog_index_page_v_latest_idx" ON "_blog_index_page_v" USING btree ("latest");
CREATE INDEX IF NOT EXISTS "_blog_index_page_v_autosave_idx" ON "_blog_index_page_v" USING btree ("autosave");
CREATE INDEX IF NOT EXISTS "locations_hero_background_idx" ON "locations" USING btree ("hero_background_id");
CREATE INDEX IF NOT EXISTS "payload_locked_documents_rels_redirects_id_idx" ON "payload_locked_documents_rels" USING btree ("redirects_id");
CREATE INDEX IF NOT EXISTS "home_page__status_idx" ON "home_page" USING btree ("_status");
CREATE INDEX IF NOT EXISTS "group_visits_page__status_idx" ON "group_visits_page" USING btree ("_status");
CREATE INDEX IF NOT EXISTS "birthday_page__status_idx" ON "birthday_page" USING btree ("_status");
CREATE INDEX IF NOT EXISTS "tickets_page__status_idx" ON "tickets_page" USING btree ("_status");
