chore(migrations): add SQL migration for kvytky→payments link fix and richtext columns
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

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 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-06-11 14:01:09 +01:00
parent 00f8742814
commit 7a15bbf9e8

View file

@ -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 $$;