From 7a15bbf9e86ea93cc4dda777da86a2fa2af824bb Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Thu, 11 Jun 2026 14:01:09 +0100 Subject: [PATCH] =?UTF-8?q?chore(migrations):=20add=20SQL=20migration=20fo?= =?UTF-8?q?r=20kvytky=E2=86=92payments=20link=20fix=20and=20richtext=20col?= =?UTF-8?q?umns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SQL migration 0020: updates header/birthday cta_href from /kvytky to /payments; converts hero_description, feature_text, bottom_text columns to jsonb for Lexical rich text. Co-Authored-By: Claude Sonnet 4.6 --- .../0020_kvytky_to_payments_richtext.sql | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 migrations/0020_kvytky_to_payments_richtext.sql diff --git a/migrations/0020_kvytky_to_payments_richtext.sql b/migrations/0020_kvytky_to_payments_richtext.sql new file mode 100644 index 0000000..434fa85 --- /dev/null +++ b/migrations/0020_kvytky_to_payments_richtext.sql @@ -0,0 +1,59 @@ +-- Fix "Купити квиток" button links: /kvytky → /payments +UPDATE "header" SET "cta_href" = '/payments' WHERE "cta_href" = '/kvytky'; +UPDATE "birthday_page_pricing_packages" SET "cta_href" = '/payments' WHERE "cta_href" = '/kvytky'; + +-- Change heroDescription, featureText, bottomText from varchar to jsonb +-- (existing text is incompatible with Lexical JSON; fields reset to NULL — re-enter via admin) +DO $$ +BEGIN + IF EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = 'group_visits_page' AND column_name = 'hero_description' + AND data_type = 'character varying' + ) THEN + ALTER TABLE "group_visits_page" ALTER COLUMN "hero_description" TYPE jsonb USING NULL; + END IF; + + IF EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = 'group_visits_page' AND column_name = 'feature_text' + AND data_type = 'character varying' + ) THEN + ALTER TABLE "group_visits_page" ALTER COLUMN "feature_text" TYPE jsonb USING NULL; + END IF; + + IF EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = 'group_visits_page' AND column_name = 'bottom_text' + AND data_type = 'character varying' + ) THEN + ALTER TABLE "group_visits_page" ALTER COLUMN "bottom_text" TYPE jsonb USING NULL; + END IF; +END $$; + +DO $$ +BEGIN + IF EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = '_group_visits_page_v' AND column_name = 'version_hero_description' + AND data_type = 'character varying' + ) THEN + ALTER TABLE "_group_visits_page_v" ALTER COLUMN "version_hero_description" TYPE jsonb USING NULL; + END IF; + + IF EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = '_group_visits_page_v' AND column_name = 'version_feature_text' + AND data_type = 'character varying' + ) THEN + ALTER TABLE "_group_visits_page_v" ALTER COLUMN "version_feature_text" TYPE jsonb USING NULL; + END IF; + + IF EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = '_group_visits_page_v' AND column_name = 'version_bottom_text' + AND data_type = 'character varying' + ) THEN + ALTER TABLE "_group_visits_page_v" ALTER COLUMN "version_bottom_text" TYPE jsonb USING NULL; + END IF; +END $$;