feat(seed): DyvoLis location record — enables /lokatsii/dyvolis
Inserts the ДивоЛіс location into locations table with showDetailPage=true plus heroTips and whyVisitItems child records. Idempotent (ON CONFLICT/DELETE+INSERT). Run by the psql migrator on next deploy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d1268c47a8
commit
5374105e06
1 changed files with 62 additions and 0 deletions
62
migrations/0003_seed_dyvolis.sql
Normal file
62
migrations/0003_seed_dyvolis.sql
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
-- Seed: DyvoLis location record with default content
|
||||
-- Idempotent: ON CONFLICT DO UPDATE / DELETE+INSERT pattern
|
||||
|
||||
INSERT INTO "locations" (
|
||||
name, slug, tagline, short_desc,
|
||||
show_in_menu, show_on_home, show_detail_page,
|
||||
hero_stat, hero_stat_label, gallery_quote,
|
||||
why_visit_title, working_hours, combo_description, sort
|
||||
)
|
||||
VALUES (
|
||||
'ДивоЛіс',
|
||||
'dyvolis',
|
||||
'Казковий топіарний парк',
|
||||
'Топіарні фігури зроблені з урахуванням важливих деталей, тому ви одразу впізнаєте в них улюблених казкових героїв. Тут можна бігати, стрибати, лазити по фігурках і ставати героями власної казки.',
|
||||
true, true, true,
|
||||
'60+',
|
||||
'експонатів з безпечних для дітей матеріалів',
|
||||
'Це місце – де малеча зустрічає героїв улюблених казок. Простір справжнього дитинства.',
|
||||
'Чому варто відвідати ДивоЛіс',
|
||||
'щодня з 11:00 до 20:00',
|
||||
'Динопарк + Диволіс із казковими топіарними фігурами + Дзеркальний лабіринт',
|
||||
10
|
||||
)
|
||||
ON CONFLICT (slug) DO UPDATE SET
|
||||
show_detail_page = true,
|
||||
hero_stat = EXCLUDED.hero_stat,
|
||||
hero_stat_label = EXCLUDED.hero_stat_label,
|
||||
gallery_quote = EXCLUDED.gallery_quote,
|
||||
why_visit_title = EXCLUDED.why_visit_title,
|
||||
working_hours = EXCLUDED.working_hours,
|
||||
combo_description = EXCLUDED.combo_description;
|
||||
|
||||
-- Hero tips (replace to stay idempotent)
|
||||
DELETE FROM "locations_hero_tips"
|
||||
WHERE _parent_id = (SELECT id FROM "locations" WHERE slug = 'dyvolis');
|
||||
|
||||
INSERT INTO "locations_hero_tips" (_order, _parent_id, id, text)
|
||||
SELECT t._order, l.id, t.id, t.text
|
||||
FROM (VALUES
|
||||
(0::int, 'tip-dyvolis-1'::text, 'Унікальна ландшафтна композиція з місцями для відпочинку'::text),
|
||||
(1::int, 'tip-dyvolis-2'::text, 'Повна свобода переміщення - без заборон'::text)
|
||||
) AS t(_order, id, text)
|
||||
CROSS JOIN (SELECT id FROM "locations" WHERE slug = 'dyvolis') AS l;
|
||||
|
||||
-- Why-visit items (replace to stay idempotent)
|
||||
DELETE FROM "locations_why_visit_items"
|
||||
WHERE _parent_id = (SELECT id FROM "locations" WHERE slug = 'dyvolis');
|
||||
|
||||
INSERT INTO "locations_why_visit_items" (_order, _parent_id, id, title, description)
|
||||
SELECT t._order, l.id, t.id, t.title, t.description
|
||||
FROM (VALUES
|
||||
(0::int, 'wvi-dyvolis-1'::text,
|
||||
'Простір для спільної фантазії'::text,
|
||||
'Вигадуйте казки та пригоди разом із дітьми — кожна топіарна фігурка стає новою сторінкою вашої власної чарівної історії.'::text),
|
||||
(1::int, 'wvi-dyvolis-2'::text,
|
||||
'Казковий ліс у справжньому лісі'::text,
|
||||
'Ми створили локацію, в якій гармонійно поєднуються казкові фігури та жива природа. Прогулянка лісом ще не була такою захопливою.'::text),
|
||||
(2::int, 'wvi-dyvolis-3'::text,
|
||||
'Магічні кадри для сімейного альбому'::text,
|
||||
'Унікальні топіарні декорації та яскраві персонажі — ідеальний фон для незабутніх сімейних фотографій, які захочеться переглядати знову і знову.'::text)
|
||||
) AS t(_order, id, title, description)
|
||||
CROSS JOIN (SELECT id FROM "locations" WHERE slug = 'dyvolis') AS l;
|
||||
Loading…
Add table
Reference in a new issue