feat(migrations): delta migration — versions, redirects, new globals, locations fields
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions

Auto-generated by Payload CLI (pnpm migrate:create) against prod DB.
Adds: locations_hero_tips/why_visit_items/review_videos tables, versions
for 6 globals (home, group_visits, birthday, tickets, locations_page,
blog_index), redirects collection, birthday_page + tickets_page tables,
meta columns on all globals, show_detail_page + rich fields on locations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-05-15 17:32:31 +01:00
parent 55a3aafc27
commit 83c4f7973a
3 changed files with 13449 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,446 @@
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
await db.execute(sql`
CREATE TYPE "public"."enum_redirects_to_type" AS ENUM('reference', 'custom');
CREATE TYPE "public"."enum_redirects_type" AS ENUM('301', '302');
CREATE TYPE "public"."enum_home_page_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum__home_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum_group_visits_page_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum__group_visits_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum_birthday_page_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum__birthday_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum_tickets_page_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum__tickets_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum_locations_page_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum__locations_page_v_version_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum_blog_index_page_status" AS ENUM('draft', 'published');
CREATE TYPE "public"."enum__blog_index_page_v_version_status" AS ENUM('draft', 'published');
CREATE TABLE "locations_hero_tips" (
"_order" integer NOT NULL,
"_parent_id" integer NOT NULL,
"id" varchar PRIMARY KEY NOT NULL,
"text" varchar NOT NULL
);
CREATE TABLE "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 "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 "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 "redirects_rels" (
"id" serial PRIMARY KEY NOT NULL,
"order" integer,
"parent_id" integer NOT NULL,
"path" varchar NOT NULL,
"pages_id" integer
);
CREATE TABLE "_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 "_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 "_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 "_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 "_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 "_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 "_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 "_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 "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 "_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 "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 "_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 "show_detail_page" boolean DEFAULT false;
ALTER TABLE "locations" ADD COLUMN "hero_background_id" integer;
ALTER TABLE "locations" ADD COLUMN "hero_stat" varchar;
ALTER TABLE "locations" ADD COLUMN "hero_stat_label" varchar;
ALTER TABLE "locations" ADD COLUMN "gallery_quote" varchar;
ALTER TABLE "locations" ADD COLUMN "why_visit_title" varchar;
ALTER TABLE "locations" ADD COLUMN "working_hours" varchar;
ALTER TABLE "locations" ADD COLUMN "combo_description" varchar;
ALTER TABLE "payload_locked_documents_rels" ADD COLUMN "redirects_id" integer;
ALTER TABLE "home_page" ADD COLUMN "_status" "enum_home_page_status" DEFAULT 'draft';
ALTER TABLE "group_visits_page" ADD COLUMN "_status" "enum_group_visits_page_status" DEFAULT 'draft';
ALTER TABLE "birthday_page" ADD COLUMN "_status" "enum_birthday_page_status" DEFAULT 'draft';
ALTER TABLE "tickets_page" ADD COLUMN "_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;
CREATE INDEX "locations_hero_tips_order_idx" ON "locations_hero_tips" USING btree ("_order");
CREATE INDEX "locations_hero_tips_parent_id_idx" ON "locations_hero_tips" USING btree ("_parent_id");
CREATE INDEX "locations_why_visit_items_order_idx" ON "locations_why_visit_items" USING btree ("_order");
CREATE INDEX "locations_why_visit_items_parent_id_idx" ON "locations_why_visit_items" USING btree ("_parent_id");
CREATE INDEX "locations_review_videos_order_idx" ON "locations_review_videos" USING btree ("_order");
CREATE INDEX "locations_review_videos_parent_id_idx" ON "locations_review_videos" USING btree ("_parent_id");
CREATE UNIQUE INDEX "redirects_from_idx" ON "redirects" USING btree ("from");
CREATE INDEX "redirects_updated_at_idx" ON "redirects" USING btree ("updated_at");
CREATE INDEX "redirects_created_at_idx" ON "redirects" USING btree ("created_at");
CREATE INDEX "redirects_rels_order_idx" ON "redirects_rels" USING btree ("order");
CREATE INDEX "redirects_rels_parent_idx" ON "redirects_rels" USING btree ("parent_id");
CREATE INDEX "redirects_rels_path_idx" ON "redirects_rels" USING btree ("path");
CREATE INDEX "redirects_rels_pages_id_idx" ON "redirects_rels" USING btree ("pages_id");
CREATE INDEX "_home_page_v_version_why_parents_items_order_idx" ON "_home_page_v_version_why_parents_items" USING btree ("_order");
CREATE INDEX "_home_page_v_version_why_parents_items_parent_id_idx" ON "_home_page_v_version_why_parents_items" USING btree ("_parent_id");
CREATE INDEX "_home_page_v_version_why_parents_side_gallery_order_idx" ON "_home_page_v_version_why_parents_side_gallery" USING btree ("_order");
CREATE INDEX "_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 "_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 "_home_page_v_version_gallery_images_order_idx" ON "_home_page_v_version_gallery_images" USING btree ("_order");
CREATE INDEX "_home_page_v_version_gallery_images_parent_id_idx" ON "_home_page_v_version_gallery_images" USING btree ("_parent_id");
CREATE INDEX "_home_page_v_version_gallery_images_image_idx" ON "_home_page_v_version_gallery_images" USING btree ("image_id");
CREATE INDEX "_home_page_v_version_hero_version_hero_background_image_idx" ON "_home_page_v" USING btree ("version_hero_background_image_id");
CREATE INDEX "_home_page_v_version_hero_version_hero_foreground_overla_idx" ON "_home_page_v" USING btree ("version_hero_foreground_overlay_id");
CREATE INDEX "_home_page_v_version_hero_version_hero_silhouette_overla_idx" ON "_home_page_v" USING btree ("version_hero_silhouette_overlay_id");
CREATE INDEX "_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 "_home_page_v_version_video_version_video_poster_idx" ON "_home_page_v" USING btree ("version_video_poster_id");
CREATE INDEX "_home_page_v_version_meta_version_meta_image_idx" ON "_home_page_v" USING btree ("version_meta_image_id");
CREATE INDEX "_home_page_v_version_version__status_idx" ON "_home_page_v" USING btree ("version__status");
CREATE INDEX "_home_page_v_created_at_idx" ON "_home_page_v" USING btree ("created_at");
CREATE INDEX "_home_page_v_updated_at_idx" ON "_home_page_v" USING btree ("updated_at");
CREATE INDEX "_home_page_v_latest_idx" ON "_home_page_v" USING btree ("latest");
CREATE INDEX "_home_page_v_autosave_idx" ON "_home_page_v" USING btree ("autosave");
CREATE INDEX "_group_visits_page_v_version_groups_order_idx" ON "_group_visits_page_v_version_groups" USING btree ("_order");
CREATE INDEX "_group_visits_page_v_version_groups_parent_id_idx" ON "_group_visits_page_v_version_groups" USING btree ("_parent_id");
CREATE INDEX "_group_visits_page_v_version_meta_version_meta_image_idx" ON "_group_visits_page_v" USING btree ("version_meta_image_id");
CREATE INDEX "_group_visits_page_v_version_version__status_idx" ON "_group_visits_page_v" USING btree ("version__status");
CREATE INDEX "_group_visits_page_v_created_at_idx" ON "_group_visits_page_v" USING btree ("created_at");
CREATE INDEX "_group_visits_page_v_updated_at_idx" ON "_group_visits_page_v" USING btree ("updated_at");
CREATE INDEX "_group_visits_page_v_latest_idx" ON "_group_visits_page_v" USING btree ("latest");
CREATE INDEX "_group_visits_page_v_autosave_idx" ON "_group_visits_page_v" USING btree ("autosave");
CREATE INDEX "_birthday_page_v_version_meta_version_meta_image_idx" ON "_birthday_page_v" USING btree ("version_meta_image_id");
CREATE INDEX "_birthday_page_v_version_version__status_idx" ON "_birthday_page_v" USING btree ("version__status");
CREATE INDEX "_birthday_page_v_created_at_idx" ON "_birthday_page_v" USING btree ("created_at");
CREATE INDEX "_birthday_page_v_updated_at_idx" ON "_birthday_page_v" USING btree ("updated_at");
CREATE INDEX "_birthday_page_v_latest_idx" ON "_birthday_page_v" USING btree ("latest");
CREATE INDEX "_birthday_page_v_autosave_idx" ON "_birthday_page_v" USING btree ("autosave");
CREATE INDEX "_tickets_page_v_version_meta_version_meta_image_idx" ON "_tickets_page_v" USING btree ("version_meta_image_id");
CREATE INDEX "_tickets_page_v_version_version__status_idx" ON "_tickets_page_v" USING btree ("version__status");
CREATE INDEX "_tickets_page_v_created_at_idx" ON "_tickets_page_v" USING btree ("created_at");
CREATE INDEX "_tickets_page_v_updated_at_idx" ON "_tickets_page_v" USING btree ("updated_at");
CREATE INDEX "_tickets_page_v_latest_idx" ON "_tickets_page_v" USING btree ("latest");
CREATE INDEX "_tickets_page_v_autosave_idx" ON "_tickets_page_v" USING btree ("autosave");
CREATE INDEX "locations_page_meta_meta_image_idx" ON "locations_page" USING btree ("meta_image_id");
CREATE INDEX "locations_page__status_idx" ON "locations_page" USING btree ("_status");
CREATE INDEX "_locations_page_v_version_meta_version_meta_image_idx" ON "_locations_page_v" USING btree ("version_meta_image_id");
CREATE INDEX "_locations_page_v_version_version__status_idx" ON "_locations_page_v" USING btree ("version__status");
CREATE INDEX "_locations_page_v_created_at_idx" ON "_locations_page_v" USING btree ("created_at");
CREATE INDEX "_locations_page_v_updated_at_idx" ON "_locations_page_v" USING btree ("updated_at");
CREATE INDEX "_locations_page_v_latest_idx" ON "_locations_page_v" USING btree ("latest");
CREATE INDEX "_locations_page_v_autosave_idx" ON "_locations_page_v" USING btree ("autosave");
CREATE INDEX "blog_index_page_meta_meta_image_idx" ON "blog_index_page" USING btree ("meta_image_id");
CREATE INDEX "blog_index_page__status_idx" ON "blog_index_page" USING btree ("_status");
CREATE INDEX "_blog_index_page_v_version_meta_version_meta_image_idx" ON "_blog_index_page_v" USING btree ("version_meta_image_id");
CREATE INDEX "_blog_index_page_v_version_version__status_idx" ON "_blog_index_page_v" USING btree ("version__status");
CREATE INDEX "_blog_index_page_v_created_at_idx" ON "_blog_index_page_v" USING btree ("created_at");
CREATE INDEX "_blog_index_page_v_updated_at_idx" ON "_blog_index_page_v" USING btree ("updated_at");
CREATE INDEX "_blog_index_page_v_latest_idx" ON "_blog_index_page_v" USING btree ("latest");
CREATE INDEX "_blog_index_page_v_autosave_idx" ON "_blog_index_page_v" USING btree ("autosave");
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 "locations_hero_background_idx" ON "locations" USING btree ("hero_background_id");
CREATE INDEX "payload_locked_documents_rels_redirects_id_idx" ON "payload_locked_documents_rels" USING btree ("redirects_id");
CREATE INDEX "home_page__status_idx" ON "home_page" USING btree ("_status");
CREATE INDEX "group_visits_page__status_idx" ON "group_visits_page" USING btree ("_status");
CREATE INDEX "birthday_page__status_idx" ON "birthday_page" USING btree ("_status");
CREATE INDEX "tickets_page__status_idx" ON "tickets_page" USING btree ("_status");`)
}
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "locations_hero_tips" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "locations_why_visit_items" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "locations_review_videos" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "redirects" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "redirects_rels" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_home_page_v_version_why_parents_items" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_home_page_v_version_why_parents_side_gallery" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_home_page_v_version_gallery_images" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_home_page_v" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_group_visits_page_v_version_groups" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_group_visits_page_v" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_birthday_page_v" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_tickets_page_v" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "locations_page" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_locations_page_v" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "blog_index_page" DISABLE ROW LEVEL SECURITY;
ALTER TABLE "_blog_index_page_v" DISABLE ROW LEVEL SECURITY;
DROP TABLE "locations_hero_tips" CASCADE;
DROP TABLE "locations_why_visit_items" CASCADE;
DROP TABLE "locations_review_videos" CASCADE;
DROP TABLE "redirects" CASCADE;
DROP TABLE "redirects_rels" CASCADE;
DROP TABLE "_home_page_v_version_why_parents_items" CASCADE;
DROP TABLE "_home_page_v_version_why_parents_side_gallery" CASCADE;
DROP TABLE "_home_page_v_version_gallery_images" CASCADE;
DROP TABLE "_home_page_v" CASCADE;
DROP TABLE "_group_visits_page_v_version_groups" CASCADE;
DROP TABLE "_group_visits_page_v" CASCADE;
DROP TABLE "_birthday_page_v" CASCADE;
DROP TABLE "_tickets_page_v" CASCADE;
DROP TABLE "locations_page" CASCADE;
DROP TABLE "_locations_page_v" CASCADE;
DROP TABLE "blog_index_page" CASCADE;
DROP TABLE "_blog_index_page_v" CASCADE;
ALTER TABLE "locations" DROP CONSTRAINT "locations_hero_background_id_media_id_fk";
ALTER TABLE "payload_locked_documents_rels" DROP CONSTRAINT "payload_locked_documents_rels_redirects_fk";
DROP INDEX "locations_hero_background_idx";
DROP INDEX "payload_locked_documents_rels_redirects_id_idx";
DROP INDEX "home_page__status_idx";
DROP INDEX "group_visits_page__status_idx";
DROP INDEX "birthday_page__status_idx";
DROP INDEX "tickets_page__status_idx";
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "icon" SET NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "title" SET NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "description" SET NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "min_people" SET NOT NULL;
ALTER TABLE "group_visits_page_groups" ALTER COLUMN "discount" SET NOT NULL;
ALTER TABLE "locations" DROP COLUMN "show_detail_page";
ALTER TABLE "locations" DROP COLUMN "hero_background_id";
ALTER TABLE "locations" DROP COLUMN "hero_stat";
ALTER TABLE "locations" DROP COLUMN "hero_stat_label";
ALTER TABLE "locations" DROP COLUMN "gallery_quote";
ALTER TABLE "locations" DROP COLUMN "why_visit_title";
ALTER TABLE "locations" DROP COLUMN "working_hours";
ALTER TABLE "locations" DROP COLUMN "combo_description";
ALTER TABLE "payload_locked_documents_rels" DROP COLUMN "redirects_id";
ALTER TABLE "home_page" DROP COLUMN "_status";
ALTER TABLE "group_visits_page" DROP COLUMN "_status";
ALTER TABLE "birthday_page" DROP COLUMN "_status";
ALTER TABLE "tickets_page" DROP COLUMN "_status";
DROP TYPE "public"."enum_redirects_to_type";
DROP TYPE "public"."enum_redirects_type";
DROP TYPE "public"."enum_home_page_status";
DROP TYPE "public"."enum__home_page_v_version_status";
DROP TYPE "public"."enum_group_visits_page_status";
DROP TYPE "public"."enum__group_visits_page_v_version_status";
DROP TYPE "public"."enum_birthday_page_status";
DROP TYPE "public"."enum__birthday_page_v_version_status";
DROP TYPE "public"."enum_tickets_page_status";
DROP TYPE "public"."enum__tickets_page_v_version_status";
DROP TYPE "public"."enum_locations_page_status";
DROP TYPE "public"."enum__locations_page_v_version_status";
DROP TYPE "public"."enum_blog_index_page_status";
DROP TYPE "public"."enum__blog_index_page_v_version_status";`)
}

View file

@ -1,4 +1,5 @@
import * as migration_20260515_153940 from './20260515_153940'
import * as migration_20260515_162527 from './20260515_162527'
export const migrations = [
{
@ -6,4 +7,9 @@ export const migrations = [
down: migration_20260515_153940.down,
name: '20260515_153940',
},
{
up: migration_20260515_162527.up,
down: migration_20260515_162527.down,
name: '20260515_162527',
},
]