chore(migrations): add SQL migration for kvytky→payments link fix and richtext columns
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:
parent
00f8742814
commit
7a15bbf9e8
1 changed files with 59 additions and 0 deletions
59
migrations/0020_kvytky_to_payments_richtext.sql
Normal file
59
migrations/0020_kvytky_to_payments_richtext.sql
Normal 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 $$;
|
||||
Loading…
Add table
Reference in a new issue