92 lines
2.7 KiB
SQL
92 lines
2.7 KiB
SQL
INSERT INTO gifts (
|
|
id,
|
|
slug,
|
|
recipient_name,
|
|
sender_name,
|
|
title,
|
|
intro_message,
|
|
reveal_message,
|
|
status
|
|
)
|
|
VALUES (
|
|
'11111111-1111-4111-8111-111111111111',
|
|
'demo',
|
|
'Anna',
|
|
'Alex',
|
|
'A little surprise for you',
|
|
'I made something for you.',
|
|
'You make ordinary days feel like something worth remembering. Here is to all the little adventures still ahead.',
|
|
'published'
|
|
)
|
|
ON CONFLICT (slug) DO UPDATE SET
|
|
recipient_name = EXCLUDED.recipient_name,
|
|
sender_name = EXCLUDED.sender_name,
|
|
title = EXCLUDED.title,
|
|
intro_message = EXCLUDED.intro_message,
|
|
reveal_message = EXCLUDED.reveal_message,
|
|
status = EXCLUDED.status,
|
|
updated_at = NOW();
|
|
|
|
INSERT INTO gift_items (id, gift_id, type, title, text, media_url, sort_order, metadata)
|
|
SELECT
|
|
'22222222-2222-4222-8222-222222222222',
|
|
id,
|
|
'image',
|
|
'The good kind of ordinary.',
|
|
'The tiny moments are usually the ones that stay with us the longest.',
|
|
'https://images.unsplash.com/photo-1511988617509-8e73b0f3b7d2?auto=format&fit=crop&w=1400&q=85',
|
|
1,
|
|
'{"caption":"A little snapshot of a very good day.","accent":"coral"}'::jsonb
|
|
FROM gifts
|
|
WHERE slug = 'demo'
|
|
ON CONFLICT (id) DO UPDATE SET
|
|
gift_id = EXCLUDED.gift_id,
|
|
type = EXCLUDED.type,
|
|
title = EXCLUDED.title,
|
|
text = EXCLUDED.text,
|
|
media_url = EXCLUDED.media_url,
|
|
sort_order = EXCLUDED.sort_order,
|
|
metadata = EXCLUDED.metadata;
|
|
|
|
INSERT INTO gift_items (id, gift_id, type, title, text, media_url, sort_order, metadata)
|
|
SELECT
|
|
'33333333-3333-4333-8333-333333333333',
|
|
id,
|
|
'text',
|
|
'A note for your next chapter.',
|
|
'Keep choosing the places, people, and tiny rituals that make you feel most like yourself. I will always be cheering for you.',
|
|
NULL,
|
|
2,
|
|
'{"eyebrow":"A note from me","accent":"lavender"}'::jsonb
|
|
FROM gifts
|
|
WHERE slug = 'demo'
|
|
ON CONFLICT (id) DO UPDATE SET
|
|
gift_id = EXCLUDED.gift_id,
|
|
type = EXCLUDED.type,
|
|
title = EXCLUDED.title,
|
|
text = EXCLUDED.text,
|
|
media_url = EXCLUDED.media_url,
|
|
sort_order = EXCLUDED.sort_order,
|
|
metadata = EXCLUDED.metadata;
|
|
|
|
INSERT INTO gift_items (id, gift_id, type, title, text, media_url, sort_order, metadata)
|
|
SELECT
|
|
'44444444-4444-4444-8444-444444444444',
|
|
id,
|
|
'text',
|
|
'One more thing.',
|
|
'There is nowhere else I would rather be than somewhere in the middle of the next story with you.',
|
|
NULL,
|
|
3,
|
|
'{"eyebrow":"P.S.","accent":"gold"}'::jsonb
|
|
FROM gifts
|
|
WHERE slug = 'demo'
|
|
ON CONFLICT (id) DO UPDATE SET
|
|
gift_id = EXCLUDED.gift_id,
|
|
type = EXCLUDED.type,
|
|
title = EXCLUDED.title,
|
|
text = EXCLUDED.text,
|
|
media_url = EXCLUDED.media_url,
|
|
sort_order = EXCLUDED.sort_order,
|
|
metadata = EXCLUDED.metadata;
|