@nextblock-cms/db 0.15.4 → 0.15.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +1,67 @@
1
- -- 00000000000006_home_sandbox_promo.sql
2
- -- Adds a "Live Demo" promo section to the English (slug 'home') and French
3
- -- (slug 'accueil') home pages that drives visitors to the public sandbox at
4
- -- https://cms.nextblock.dev -- production (nextblock.dev) never mentioned it before.
5
- --
6
- -- The section is inserted right after the hero (order 1); existing home-page blocks
7
- -- shift down by one so relative order is preserved. Each block carries a sentinel
8
- -- comment (nb-sandbox-promo) inside its HTML so the sandbox reset route can strip it
9
- -- there: a CTA pointing at the sandbox is pointless *inside* the sandbox itself.
10
- --
11
- -- Forward-only and idempotent: the NOT EXISTS sentinel guard makes a re-run a no-op,
12
- -- and page lookups are by (language code, slug) so explicit IDs never collide with
13
- -- user-created blocks on a live database.
14
-
15
- DO $body$
16
- DECLARE
17
- v_en_lang integer;
18
- v_fr_lang integer;
19
- v_en_page integer;
20
- v_fr_page integer;
21
- BEGIN
22
- SELECT id INTO v_en_lang FROM public.languages WHERE code = 'en' LIMIT 1;
23
- SELECT id INTO v_fr_lang FROM public.languages WHERE code = 'fr' LIMIT 1;
24
-
25
- -- English home page
26
- SELECT id INTO v_en_page
27
- FROM public.pages
28
- WHERE slug = 'home' AND language_id = v_en_lang
29
- ORDER BY id
30
- LIMIT 1;
31
-
32
- IF v_en_page IS NOT NULL AND NOT EXISTS (
33
- SELECT 1 FROM public.blocks
34
- WHERE page_id = v_en_page AND content::text LIKE '%nb-sandbox-promo%'
35
- ) THEN
36
- UPDATE public.blocks
37
- SET "order" = "order" + 1
38
- WHERE page_id = v_en_page AND "order" >= 1;
39
-
40
- INSERT INTO public.blocks (page_id, language_id, block_type, content, "order")
41
- VALUES (v_en_page, v_en_lang, 'section', $en$
42
- {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>Live Demo &middot; No Signup</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Try the full CMS,<br/>live right now.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Don't just read about NextBlock&trade; &mdash; take the wheel. Our public sandbox is a complete, pre-loaded install where you can build pages with the block editor, manage bilingual content, and browse a working demo store. It resets every hour, so explore freely and break whatever you like.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-gradient-to-r from-blue-600 to-cyan-500 hover:from-blue-500 hover:to-cyan-400 shadow-lg shadow-blue-500/25 transition-all no-underline'>Explore the Live Demo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Open the CMS Dashboard &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Demo login <span class='font-mono text-slate-300'>demo@nextblock.ca</span> / <span class='font-mono text-slate-300'>password</span> &middot; Resets hourly</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>A living NextBlock&trade; install &mdash; everything here is real and clickable:</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Full block editor</strong> with slash commands &amp; drag-and-drop.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Bilingual</strong> English / French content management.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>A complete demo storefront</strong> with live checkout.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Wipes clean every hour</strong> &mdash; always a fresh start.</span></li></ul></div></div>"}}]]}
43
- $en$::jsonb, 1);
44
- END IF;
45
-
46
- -- French home page
47
- SELECT id INTO v_fr_page
48
- FROM public.pages
49
- WHERE slug = 'accueil' AND language_id = v_fr_lang
50
- ORDER BY id
51
- LIMIT 1;
52
-
53
- IF v_fr_page IS NOT NULL AND NOT EXISTS (
54
- SELECT 1 FROM public.blocks
55
- WHERE page_id = v_fr_page AND content::text LIKE '%nb-sandbox-promo%'
56
- ) THEN
57
- UPDATE public.blocks
58
- SET "order" = "order" + 1
59
- WHERE page_id = v_fr_page AND "order" >= 1;
60
-
61
- INSERT INTO public.blocks (page_id, language_id, block_type, content, "order")
62
- VALUES (v_fr_page, v_fr_lang, 'section', $fr$
63
- {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>D&eacute;mo en direct &middot; Sans inscription</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Essayez le CMS complet,<br/>en direct d&egrave;s maintenant.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Ne vous contentez pas de lire &agrave; propos de NextBlock&trade; &mdash; prenez les commandes. Notre bac &agrave; sable public est une installation compl&egrave;te et pr&eacute;charg&eacute;e o&ugrave; vous pouvez cr&eacute;er des pages avec l'&eacute;diteur de blocs, g&eacute;rer du contenu bilingue et parcourir une vraie boutique de d&eacute;monstration. Il se r&eacute;initialise chaque heure : explorez librement et cassez tout ce que vous voulez.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-gradient-to-r from-blue-600 to-cyan-500 hover:from-blue-500 hover:to-cyan-400 shadow-lg shadow-blue-500/25 transition-all no-underline'>D&eacute;couvrir la d&eacute;mo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Ouvrir le tableau de bord &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Identifiants d&eacute;mo <span class='font-mono text-slate-300'>demo@nextblock.ca</span> / <span class='font-mono text-slate-300'>password</span> &middot; R&eacute;initialis&eacute; chaque heure</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>Une installation NextBlock&trade; bien vivante &mdash; tout ici est r&eacute;el et cliquable :</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>&Eacute;diteur de blocs complet</strong> : commandes slash et glisser-d&eacute;poser.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Gestion bilingue</strong> du contenu fran&ccedil;ais / anglais.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Une boutique de d&eacute;monstration compl&egrave;te</strong> avec paiement r&eacute;el.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Remis &agrave; z&eacute;ro chaque heure</strong> &mdash; toujours un nouveau d&eacute;part.</span></li></ul></div></div>"}}]]}
64
- $fr$::jsonb, 1);
65
- END IF;
66
- END
67
- $body$;
1
+ -- 00000000000006_home_sandbox_promo.sql
2
+ -- Adds a "Live Demo" promo section to the English (slug 'home') and French
3
+ -- (slug 'accueil') home pages that drives visitors to the public sandbox at
4
+ -- https://cms.nextblock.dev -- production (nextblock.dev) never mentioned it before.
5
+ --
6
+ -- The section is inserted right after the hero (order 1); existing home-page blocks
7
+ -- shift down by one so relative order is preserved. Each block carries a sentinel
8
+ -- comment (nb-sandbox-promo) inside its HTML so the sandbox reset route can strip it
9
+ -- there: a CTA pointing at the sandbox is pointless *inside* the sandbox itself.
10
+ --
11
+ -- Forward-only and idempotent: the NOT EXISTS sentinel guard makes a re-run a no-op,
12
+ -- and page lookups are by (language code, slug) so explicit IDs never collide with
13
+ -- user-created blocks on a live database.
14
+
15
+ DO $body$
16
+ DECLARE
17
+ v_en_lang integer;
18
+ v_fr_lang integer;
19
+ v_en_page integer;
20
+ v_fr_page integer;
21
+ BEGIN
22
+ SELECT id INTO v_en_lang FROM public.languages WHERE code = 'en' LIMIT 1;
23
+ SELECT id INTO v_fr_lang FROM public.languages WHERE code = 'fr' LIMIT 1;
24
+
25
+ -- English home page
26
+ SELECT id INTO v_en_page
27
+ FROM public.pages
28
+ WHERE slug = 'home' AND language_id = v_en_lang
29
+ ORDER BY id
30
+ LIMIT 1;
31
+
32
+ IF v_en_page IS NOT NULL AND NOT EXISTS (
33
+ SELECT 1 FROM public.blocks
34
+ WHERE page_id = v_en_page AND content::text LIKE '%nb-sandbox-promo%'
35
+ ) THEN
36
+ UPDATE public.blocks
37
+ SET "order" = "order" + 1
38
+ WHERE page_id = v_en_page AND "order" >= 1;
39
+
40
+ INSERT INTO public.blocks (page_id, language_id, block_type, content, "order")
41
+ VALUES (v_en_page, v_en_lang, 'section', $en$
42
+ {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>Live Demo &middot; No Signup</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Try the full CMS,<br/>live right now.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Don't just read about NextBlock&trade; &mdash; take the wheel. Our public sandbox is a complete, pre-loaded install where you can build pages with the block editor, manage bilingual content, and browse a working demo store. It resets every hour, so explore freely and break whatever you like.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-gradient-to-r from-blue-600 to-cyan-500 hover:from-blue-500 hover:to-cyan-400 shadow-lg shadow-blue-500/25 transition-all no-underline'>Explore the Live Demo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Open the CMS Dashboard &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Demo login <span class='font-mono text-slate-300'>demo@nextblock.dev</span> / <span class='font-mono text-slate-300'>password</span> &middot; Resets hourly</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>A living NextBlock&trade; install &mdash; everything here is real and clickable:</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Full block editor</strong> with slash commands &amp; drag-and-drop.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Bilingual</strong> English / French content management.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>A complete demo storefront</strong> with live checkout.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Wipes clean every hour</strong> &mdash; always a fresh start.</span></li></ul></div></div>"}}]]}
43
+ $en$::jsonb, 1);
44
+ END IF;
45
+
46
+ -- French home page
47
+ SELECT id INTO v_fr_page
48
+ FROM public.pages
49
+ WHERE slug = 'accueil' AND language_id = v_fr_lang
50
+ ORDER BY id
51
+ LIMIT 1;
52
+
53
+ IF v_fr_page IS NOT NULL AND NOT EXISTS (
54
+ SELECT 1 FROM public.blocks
55
+ WHERE page_id = v_fr_page AND content::text LIKE '%nb-sandbox-promo%'
56
+ ) THEN
57
+ UPDATE public.blocks
58
+ SET "order" = "order" + 1
59
+ WHERE page_id = v_fr_page AND "order" >= 1;
60
+
61
+ INSERT INTO public.blocks (page_id, language_id, block_type, content, "order")
62
+ VALUES (v_fr_page, v_fr_lang, 'section', $fr$
63
+ {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>D&eacute;mo en direct &middot; Sans inscription</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Essayez le CMS complet,<br/>en direct d&egrave;s maintenant.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Ne vous contentez pas de lire &agrave; propos de NextBlock&trade; &mdash; prenez les commandes. Notre bac &agrave; sable public est une installation compl&egrave;te et pr&eacute;charg&eacute;e o&ugrave; vous pouvez cr&eacute;er des pages avec l'&eacute;diteur de blocs, g&eacute;rer du contenu bilingue et parcourir une vraie boutique de d&eacute;monstration. Il se r&eacute;initialise chaque heure : explorez librement et cassez tout ce que vous voulez.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-gradient-to-r from-blue-600 to-cyan-500 hover:from-blue-500 hover:to-cyan-400 shadow-lg shadow-blue-500/25 transition-all no-underline'>D&eacute;couvrir la d&eacute;mo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Ouvrir le tableau de bord &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Identifiants d&eacute;mo <span class='font-mono text-slate-300'>demo@nextblock.dev</span> / <span class='font-mono text-slate-300'>password</span> &middot; R&eacute;initialis&eacute; chaque heure</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>Une installation NextBlock&trade; bien vivante &mdash; tout ici est r&eacute;el et cliquable :</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>&Eacute;diteur de blocs complet</strong> : commandes slash et glisser-d&eacute;poser.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Gestion bilingue</strong> du contenu fran&ccedil;ais / anglais.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Une boutique de d&eacute;monstration compl&egrave;te</strong> avec paiement r&eacute;el.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Remis &agrave; z&eacute;ro chaque heure</strong> &mdash; toujours un nouveau d&eacute;part.</span></li></ul></div></div>"}}]]}
64
+ $fr$::jsonb, 1);
65
+ END IF;
66
+ END
67
+ $body$;
@@ -1,49 +1,49 @@
1
- -- 00000000000007_home_live_demo_promo_copy_fix.sql
2
- -- Corrects the "Live Demo" promo that migration 006 seeded on the EN (slug 'home')
3
- -- and FR (slug 'accueil') home pages. 006 was already applied to production and the
4
- -- sandbox, so per the append-only rule this ships the corrections as a forward-only
5
- -- UPDATE instead of editing 006 (which would never re-run and would desync the file
6
- -- from what was actually applied).
7
- --
8
- -- Fixes: reset cadence "hourly" -> "daily" (the reset cron in vercel.json is daily,
9
- -- 0 3 * * *, not hourly); FR "avec paiement reel" -> "un parcours de paiement complet"
10
- -- (sandbox checkout is simulated); FR anglicism "lire a propos de" -> "lire des
11
- -- articles sur"; and an accessible WCAG-AA primary CTA (solid blue-600, was white on
12
- -- a low-contrast cyan gradient).
13
- --
14
- -- Idempotent: re-running sets identical content. Targets exactly the promo blocks via
15
- -- the nb-sandbox-promo sentinel, scoped by language. On the sandbox the promo is still
16
- -- stripped afterward by removeSandboxPromoSections in the reset-sandbox route.
17
- --
18
- -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts
19
- -- excludes any migration whose filename contains "sandbox" from the reset bundle.
20
-
21
- DO $body$
22
- DECLARE
23
- v_en_lang integer;
24
- v_fr_lang integer;
25
- BEGIN
26
- SELECT id INTO v_en_lang FROM public.languages WHERE code = 'en' LIMIT 1;
27
- SELECT id INTO v_fr_lang FROM public.languages WHERE code = 'fr' LIMIT 1;
28
-
29
- UPDATE public.blocks
30
- SET content = $en$
31
- {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>Live Demo &middot; No Signup</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Try the full CMS,<br/>live right now.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Don't just read about NextBlock&trade; &mdash; take the wheel. Our public sandbox is a complete, pre-loaded install where you can build pages with the block editor, manage bilingual content, and browse a working demo store. It resets daily, so explore freely and break whatever you like.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-cyan-500/20 transition-all no-underline'>Explore the Live Demo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Open the CMS Dashboard &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Demo login <span class='font-mono text-slate-300'>demo@nextblock.ca</span> / <span class='font-mono text-slate-300'>password</span> &middot; Resets daily</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>A living NextBlock&trade; install &mdash; everything here is real and clickable:</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Full block editor</strong> with slash commands &amp; drag-and-drop.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Bilingual</strong> English / French content management.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>A complete demo storefront</strong> with a full checkout flow.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Wipes clean daily</strong> &mdash; always a fresh start.</span></li></ul></div></div>"}}]]}
32
- $en$::jsonb,
33
- updated_at = now()
34
- WHERE block_type = 'section'
35
- AND page_id IS NOT NULL
36
- AND language_id = v_en_lang
37
- AND content::text LIKE '%nb-sandbox-promo%';
38
-
39
- UPDATE public.blocks
40
- SET content = $fr$
41
- {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>D&eacute;mo en direct &middot; Sans inscription</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Essayez le CMS complet,<br/>en direct d&egrave;s maintenant.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Ne vous contentez pas de lire des articles sur NextBlock&trade; &mdash; prenez les commandes. Notre bac &agrave; sable public est une installation compl&egrave;te et pr&eacute;charg&eacute;e o&ugrave; vous pouvez cr&eacute;er des pages avec l'&eacute;diteur de blocs, g&eacute;rer du contenu bilingue et parcourir une vraie boutique de d&eacute;monstration. Il se r&eacute;initialise chaque jour : explorez librement et cassez tout ce que vous voulez.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-cyan-500/20 transition-all no-underline'>D&eacute;couvrir la d&eacute;mo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Ouvrir le tableau de bord &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Identifiants d&eacute;mo <span class='font-mono text-slate-300'>demo@nextblock.ca</span> / <span class='font-mono text-slate-300'>password</span> &middot; R&eacute;initialis&eacute; chaque jour</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>Une installation NextBlock&trade; bien vivante &mdash; tout ici est r&eacute;el et cliquable :</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>&Eacute;diteur de blocs complet</strong> : commandes slash et glisser-d&eacute;poser.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Gestion bilingue</strong> du contenu fran&ccedil;ais / anglais.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Une boutique de d&eacute;monstration compl&egrave;te</strong> avec un parcours de paiement complet.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Remis &agrave; z&eacute;ro chaque jour</strong> &mdash; toujours un nouveau d&eacute;part.</span></li></ul></div></div>"}}]]}
42
- $fr$::jsonb,
43
- updated_at = now()
44
- WHERE block_type = 'section'
45
- AND page_id IS NOT NULL
46
- AND language_id = v_fr_lang
47
- AND content::text LIKE '%nb-sandbox-promo%';
48
- END
49
- $body$;
1
+ -- 00000000000007_home_live_demo_promo_copy_fix.sql
2
+ -- Corrects the "Live Demo" promo that migration 006 seeded on the EN (slug 'home')
3
+ -- and FR (slug 'accueil') home pages. 006 was already applied to production and the
4
+ -- sandbox, so per the append-only rule this ships the corrections as a forward-only
5
+ -- UPDATE instead of editing 006 (which would never re-run and would desync the file
6
+ -- from what was actually applied).
7
+ --
8
+ -- Fixes: reset cadence "hourly" -> "daily" (the reset cron in vercel.json is daily,
9
+ -- 0 3 * * *, not hourly); FR "avec paiement reel" -> "un parcours de paiement complet"
10
+ -- (sandbox checkout is simulated); FR anglicism "lire a propos de" -> "lire des
11
+ -- articles sur"; and an accessible WCAG-AA primary CTA (solid blue-600, was white on
12
+ -- a low-contrast cyan gradient).
13
+ --
14
+ -- Idempotent: re-running sets identical content. Targets exactly the promo blocks via
15
+ -- the nb-sandbox-promo sentinel, scoped by language. On the sandbox the promo is still
16
+ -- stripped afterward by removeSandboxPromoSections in the reset-sandbox route.
17
+ --
18
+ -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts
19
+ -- excludes any migration whose filename contains "sandbox" from the reset bundle.
20
+
21
+ DO $body$
22
+ DECLARE
23
+ v_en_lang integer;
24
+ v_fr_lang integer;
25
+ BEGIN
26
+ SELECT id INTO v_en_lang FROM public.languages WHERE code = 'en' LIMIT 1;
27
+ SELECT id INTO v_fr_lang FROM public.languages WHERE code = 'fr' LIMIT 1;
28
+
29
+ UPDATE public.blocks
30
+ SET content = $en$
31
+ {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>Live Demo &middot; No Signup</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Try the full CMS,<br/>live right now.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Don't just read about NextBlock&trade; &mdash; take the wheel. Our public sandbox is a complete, pre-loaded install where you can build pages with the block editor, manage bilingual content, and browse a working demo store. It resets daily, so explore freely and break whatever you like.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-cyan-500/20 transition-all no-underline'>Explore the Live Demo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Open the CMS Dashboard &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Demo login <span class='font-mono text-slate-300'>demo@nextblock.dev</span> / <span class='font-mono text-slate-300'>password</span> &middot; Resets daily</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>A living NextBlock&trade; install &mdash; everything here is real and clickable:</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Full block editor</strong> with slash commands &amp; drag-and-drop.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Bilingual</strong> English / French content management.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>A complete demo storefront</strong> with a full checkout flow.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Wipes clean daily</strong> &mdash; always a fresh start.</span></li></ul></div></div>"}}]]}
32
+ $en$::jsonb,
33
+ updated_at = now()
34
+ WHERE block_type = 'section'
35
+ AND page_id IS NOT NULL
36
+ AND language_id = v_en_lang
37
+ AND content::text LIKE '%nb-sandbox-promo%';
38
+
39
+ UPDATE public.blocks
40
+ SET content = $fr$
41
+ {"container_type":"container","background":{"type":"gradient","gradient":{"type":"linear","direction":"135deg","stops":[{"color":"#020817","position":0},{"color":"#0b1e3d","position":50},{"color":"#0e2a4d","position":100}]}},"responsive_columns":{"mobile":1,"tablet":1,"desktop":2},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><p class='text-xs uppercase tracking-[0.25em] text-cyan-400 font-bold mb-4'>D&eacute;mo en direct &middot; Sans inscription</p><h2 class='text-4xl md:text-5xl font-bold text-white mb-6 leading-tight'>Essayez le CMS complet,<br/>en direct d&egrave;s maintenant.</h2><p class='text-lg text-slate-300 max-w-xl leading-relaxed mb-8'>Ne vous contentez pas de lire des articles sur NextBlock&trade; &mdash; prenez les commandes. Notre bac &agrave; sable public est une installation compl&egrave;te et pr&eacute;charg&eacute;e o&ugrave; vous pouvez cr&eacute;er des pages avec l'&eacute;diteur de blocs, g&eacute;rer du contenu bilingue et parcourir une vraie boutique de d&eacute;monstration. Il se r&eacute;initialise chaque jour : explorez librement et cassez tout ce que vous voulez.</p>"}},{"block_type":"text","content":{"html_content":"<div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-cyan-500/20 transition-all no-underline'>D&eacute;couvrir la d&eacute;mo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white border border-white/20 hover:bg-white/10 backdrop-blur-sm transition-all no-underline'>Ouvrir le tableau de bord &rarr;</a></div><p class='text-xs text-slate-400 mt-4'>Identifiants d&eacute;mo <span class='font-mono text-slate-300'>demo@nextblock.dev</span> / <span class='font-mono text-slate-300'>password</span> &middot; R&eacute;initialis&eacute; chaque jour</p>"}}],[{"block_type":"text","content":{"html_content":"<div class='rounded-3xl overflow-hidden border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>Une installation NextBlock&trade; bien vivante &mdash; tout ici est r&eacute;el et cliquable :</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>&Eacute;diteur de blocs complet</strong> : commandes slash et glisser-d&eacute;poser.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Gestion bilingue</strong> du contenu fran&ccedil;ais / anglais.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Une boutique de d&eacute;monstration compl&egrave;te</strong> avec un parcours de paiement complet.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Remis &agrave; z&eacute;ro chaque jour</strong> &mdash; toujours un nouveau d&eacute;part.</span></li></ul></div></div>"}}]]}
42
+ $fr$::jsonb,
43
+ updated_at = now()
44
+ WHERE block_type = 'section'
45
+ AND page_id IS NOT NULL
46
+ AND language_id = v_fr_lang
47
+ AND content::text LIKE '%nb-sandbox-promo%';
48
+ END
49
+ $body$;
@@ -1,52 +1,52 @@
1
- -- 00000000000009_home_live_demo_promo_contrast.sql
2
- -- Restyles the "Live Demo" promo that migrations 006/007 seeded on the EN (slug 'home')
3
- -- and FR (slug 'accueil') home pages. 006/007 gave it a fixed dark-navy GRADIENT section
4
- -- background -- and a gradient background is an inline style, so it renders identically
5
- -- in light and dark theme. Sitting directly under the (also dark) hero, that made the
6
- -- first two sections both dark in light mode and killed the old dark-hero -> white-second
7
- -- contrast rhythm.
8
- --
9
- -- Fix (append-only, do NOT edit 006/007 -- both already applied to prod + sandbox):
10
- -- switch the section background to "none" (transparent -> inherits the theme-aware page
11
- -- background: light in light theme, dark in dark theme) and render the promo as a single
12
- -- self-contained ELEVATED PANEL. The panel is a soft light card in light theme and keeps
13
- -- the rich navy look in dark theme (dark: gradient), with the browser mockup deliberately
14
- -- kept dark in both themes as a "product screenshot" focal point. The <!--nb-sandbox-promo-->
15
- -- sentinel is preserved so the reset-sandbox route still strips it on cms.nextblock.dev.
16
- --
17
- -- Idempotent: re-running sets identical content. Targets exactly the promo blocks via the
18
- -- nb-sandbox-promo sentinel, scoped by language (mirrors 00000000000007). blocks.content is
19
- -- JSONB, written with dollar-quoting.
20
- --
21
- -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts excludes
22
- -- any migration whose filename contains "sandbox" from the sandbox reset bundle.
23
-
24
- DO $body$
25
- DECLARE
26
- v_en_lang integer;
27
- v_fr_lang integer;
28
- BEGIN
29
- SELECT id INTO v_en_lang FROM public.languages WHERE code = 'en' LIMIT 1;
30
- SELECT id INTO v_fr_lang FROM public.languages WHERE code = 'fr' LIMIT 1;
31
-
32
- UPDATE public.blocks
33
- SET content = $en$
34
- {"container_type":"container","background":{"type":"none"},"responsive_columns":{"mobile":1,"tablet":1,"desktop":1},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><div class='relative overflow-hidden rounded-[2.5rem] border border-slate-200 bg-gradient-to-br from-white via-slate-50 to-blue-50 shadow-2xl shadow-slate-900/10 dark:border-white/10 dark:from-slate-900 dark:via-slate-900 dark:to-blue-950 dark:shadow-black/40'><div class='grid gap-10 p-8 sm:p-12 lg:grid-cols-2 lg:items-center'><div><p class='text-xs uppercase tracking-[0.25em] text-cyan-600 dark:text-cyan-400 font-bold mb-4'>Live Demo &middot; No Signup</p><h2 class='text-4xl md:text-5xl font-bold text-slate-900 dark:text-white mb-6 leading-tight'>Try the full CMS,<br/>live right now.</h2><p class='text-lg text-slate-600 dark:text-slate-300 max-w-xl leading-relaxed mb-8'>Don't just read about NextBlock&trade; &mdash; take the wheel. Our public sandbox is a complete, pre-loaded install where you can build pages with the block editor, manage bilingual content, and browse a working demo store. It resets daily, so explore freely and break whatever you like.</p><div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-blue-500/25 transition-all no-underline'>Explore the Live Demo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-slate-700 dark:text-white border border-slate-300 dark:border-white/20 hover:bg-slate-100 dark:hover:bg-white/10 transition-all no-underline'>Open the CMS Dashboard &rarr;</a></div><p class='text-xs text-slate-500 dark:text-slate-400 mt-4'>Demo login <span class='font-mono text-slate-700 dark:text-slate-300'>demo@nextblock.ca</span> / <span class='font-mono text-slate-700 dark:text-slate-300'>password</span> &middot; Resets daily</p></div><div class='rounded-3xl overflow-hidden border border-slate-800 bg-slate-900 shadow-xl shadow-slate-900/20 dark:border-white/10 dark:bg-white/5 dark:backdrop-blur-xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>A living NextBlock&trade; install &mdash; everything here is real and clickable:</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Full block editor</strong> with slash commands &amp; drag-and-drop.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Bilingual</strong> English / French content management.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>A complete demo storefront</strong> with a full checkout flow.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Wipes clean daily</strong> &mdash; always a fresh start.</span></li></ul></div></div></div></div>"}}]]}
35
- $en$::jsonb,
36
- updated_at = now()
37
- WHERE block_type = 'section'
38
- AND page_id IS NOT NULL
39
- AND language_id = v_en_lang
40
- AND content::text LIKE '%nb-sandbox-promo%';
41
-
42
- UPDATE public.blocks
43
- SET content = $fr$
44
- {"container_type":"container","background":{"type":"none"},"responsive_columns":{"mobile":1,"tablet":1,"desktop":1},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><div class='relative overflow-hidden rounded-[2.5rem] border border-slate-200 bg-gradient-to-br from-white via-slate-50 to-blue-50 shadow-2xl shadow-slate-900/10 dark:border-white/10 dark:from-slate-900 dark:via-slate-900 dark:to-blue-950 dark:shadow-black/40'><div class='grid gap-10 p-8 sm:p-12 lg:grid-cols-2 lg:items-center'><div><p class='text-xs uppercase tracking-[0.25em] text-cyan-600 dark:text-cyan-400 font-bold mb-4'>D&eacute;mo en direct &middot; Sans inscription</p><h2 class='text-4xl md:text-5xl font-bold text-slate-900 dark:text-white mb-6 leading-tight'>Essayez le CMS complet,<br/>en direct d&egrave;s maintenant.</h2><p class='text-lg text-slate-600 dark:text-slate-300 max-w-xl leading-relaxed mb-8'>Ne vous contentez pas de lire des articles sur NextBlock&trade; &mdash; prenez les commandes. Notre bac &agrave; sable public est une installation compl&egrave;te et pr&eacute;charg&eacute;e o&ugrave; vous pouvez cr&eacute;er des pages avec l'&eacute;diteur de blocs, g&eacute;rer du contenu bilingue et parcourir une vraie boutique de d&eacute;monstration. Il se r&eacute;initialise chaque jour : explorez librement et cassez tout ce que vous voulez.</p><div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-blue-500/25 transition-all no-underline'>D&eacute;couvrir la d&eacute;mo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-slate-700 dark:text-white border border-slate-300 dark:border-white/20 hover:bg-slate-100 dark:hover:bg-white/10 transition-all no-underline'>Ouvrir le tableau de bord &rarr;</a></div><p class='text-xs text-slate-500 dark:text-slate-400 mt-4'>Identifiants d&eacute;mo <span class='font-mono text-slate-700 dark:text-slate-300'>demo@nextblock.ca</span> / <span class='font-mono text-slate-700 dark:text-slate-300'>password</span> &middot; R&eacute;initialis&eacute; chaque jour</p></div><div class='rounded-3xl overflow-hidden border border-slate-800 bg-slate-900 shadow-xl shadow-slate-900/20 dark:border-white/10 dark:bg-white/5 dark:backdrop-blur-xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>Une installation NextBlock&trade; bien vivante &mdash; tout ici est r&eacute;el et cliquable :</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>&Eacute;diteur de blocs complet</strong> : commandes slash et glisser-d&eacute;poser.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Gestion bilingue</strong> du contenu fran&ccedil;ais / anglais.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Une boutique de d&eacute;monstration compl&egrave;te</strong> avec un parcours de paiement complet.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Remis &agrave; z&eacute;ro chaque jour</strong> &mdash; toujours un nouveau d&eacute;part.</span></li></ul></div></div></div></div>"}}]]}
45
- $fr$::jsonb,
46
- updated_at = now()
47
- WHERE block_type = 'section'
48
- AND page_id IS NOT NULL
49
- AND language_id = v_fr_lang
50
- AND content::text LIKE '%nb-sandbox-promo%';
51
- END
52
- $body$;
1
+ -- 00000000000009_home_live_demo_promo_contrast.sql
2
+ -- Restyles the "Live Demo" promo that migrations 006/007 seeded on the EN (slug 'home')
3
+ -- and FR (slug 'accueil') home pages. 006/007 gave it a fixed dark-navy GRADIENT section
4
+ -- background -- and a gradient background is an inline style, so it renders identically
5
+ -- in light and dark theme. Sitting directly under the (also dark) hero, that made the
6
+ -- first two sections both dark in light mode and killed the old dark-hero -> white-second
7
+ -- contrast rhythm.
8
+ --
9
+ -- Fix (append-only, do NOT edit 006/007 -- both already applied to prod + sandbox):
10
+ -- switch the section background to "none" (transparent -> inherits the theme-aware page
11
+ -- background: light in light theme, dark in dark theme) and render the promo as a single
12
+ -- self-contained ELEVATED PANEL. The panel is a soft light card in light theme and keeps
13
+ -- the rich navy look in dark theme (dark: gradient), with the browser mockup deliberately
14
+ -- kept dark in both themes as a "product screenshot" focal point. The <!--nb-sandbox-promo-->
15
+ -- sentinel is preserved so the reset-sandbox route still strips it on cms.nextblock.dev.
16
+ --
17
+ -- Idempotent: re-running sets identical content. Targets exactly the promo blocks via the
18
+ -- nb-sandbox-promo sentinel, scoped by language (mirrors 00000000000007). blocks.content is
19
+ -- JSONB, written with dollar-quoting.
20
+ --
21
+ -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts excludes
22
+ -- any migration whose filename contains "sandbox" from the sandbox reset bundle.
23
+
24
+ DO $body$
25
+ DECLARE
26
+ v_en_lang integer;
27
+ v_fr_lang integer;
28
+ BEGIN
29
+ SELECT id INTO v_en_lang FROM public.languages WHERE code = 'en' LIMIT 1;
30
+ SELECT id INTO v_fr_lang FROM public.languages WHERE code = 'fr' LIMIT 1;
31
+
32
+ UPDATE public.blocks
33
+ SET content = $en$
34
+ {"container_type":"container","background":{"type":"none"},"responsive_columns":{"mobile":1,"tablet":1,"desktop":1},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><div class='relative overflow-hidden rounded-[2.5rem] border border-slate-200 bg-gradient-to-br from-white via-slate-50 to-blue-50 shadow-2xl shadow-slate-900/10 dark:border-white/10 dark:from-slate-900 dark:via-slate-900 dark:to-blue-950 dark:shadow-black/40'><div class='grid gap-10 p-8 sm:p-12 lg:grid-cols-2 lg:items-center'><div><p class='text-xs uppercase tracking-[0.25em] text-cyan-600 dark:text-cyan-400 font-bold mb-4'>Live Demo &middot; No Signup</p><h2 class='text-4xl md:text-5xl font-bold text-slate-900 dark:text-white mb-6 leading-tight'>Try the full CMS,<br/>live right now.</h2><p class='text-lg text-slate-600 dark:text-slate-300 max-w-xl leading-relaxed mb-8'>Don't just read about NextBlock&trade; &mdash; take the wheel. Our public sandbox is a complete, pre-loaded install where you can build pages with the block editor, manage bilingual content, and browse a working demo store. It resets daily, so explore freely and break whatever you like.</p><div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-blue-500/25 transition-all no-underline'>Explore the Live Demo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-slate-700 dark:text-white border border-slate-300 dark:border-white/20 hover:bg-slate-100 dark:hover:bg-white/10 transition-all no-underline'>Open the CMS Dashboard &rarr;</a></div><p class='text-xs text-slate-500 dark:text-slate-400 mt-4'>Demo login <span class='font-mono text-slate-700 dark:text-slate-300'>demo@nextblock.dev</span> / <span class='font-mono text-slate-700 dark:text-slate-300'>password</span> &middot; Resets daily</p></div><div class='rounded-3xl overflow-hidden border border-slate-800 bg-slate-900 shadow-xl shadow-slate-900/20 dark:border-white/10 dark:bg-white/5 dark:backdrop-blur-xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>A living NextBlock&trade; install &mdash; everything here is real and clickable:</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Full block editor</strong> with slash commands &amp; drag-and-drop.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Bilingual</strong> English / French content management.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>A complete demo storefront</strong> with a full checkout flow.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Wipes clean daily</strong> &mdash; always a fresh start.</span></li></ul></div></div></div></div>"}}]]}
35
+ $en$::jsonb,
36
+ updated_at = now()
37
+ WHERE block_type = 'section'
38
+ AND page_id IS NOT NULL
39
+ AND language_id = v_en_lang
40
+ AND content::text LIKE '%nb-sandbox-promo%';
41
+
42
+ UPDATE public.blocks
43
+ SET content = $fr$
44
+ {"container_type":"container","background":{"type":"none"},"responsive_columns":{"mobile":1,"tablet":1,"desktop":1},"column_gap":"xl","vertical_alignment":"center","padding":{"top":"xl","bottom":"xl"},"column_blocks":[[{"block_type":"text","content":{"html_content":"<!--nb-sandbox-promo--><div class='relative overflow-hidden rounded-[2.5rem] border border-slate-200 bg-gradient-to-br from-white via-slate-50 to-blue-50 shadow-2xl shadow-slate-900/10 dark:border-white/10 dark:from-slate-900 dark:via-slate-900 dark:to-blue-950 dark:shadow-black/40'><div class='grid gap-10 p-8 sm:p-12 lg:grid-cols-2 lg:items-center'><div><p class='text-xs uppercase tracking-[0.25em] text-cyan-600 dark:text-cyan-400 font-bold mb-4'>D&eacute;mo en direct &middot; Sans inscription</p><h2 class='text-4xl md:text-5xl font-bold text-slate-900 dark:text-white mb-6 leading-tight'>Essayez le CMS complet,<br/>en direct d&egrave;s maintenant.</h2><p class='text-lg text-slate-600 dark:text-slate-300 max-w-xl leading-relaxed mb-8'>Ne vous contentez pas de lire des articles sur NextBlock&trade; &mdash; prenez les commandes. Notre bac &agrave; sable public est une installation compl&egrave;te et pr&eacute;charg&eacute;e o&ugrave; vous pouvez cr&eacute;er des pages avec l'&eacute;diteur de blocs, g&eacute;rer du contenu bilingue et parcourir une vraie boutique de d&eacute;monstration. Il se r&eacute;initialise chaque jour : explorez librement et cassez tout ce que vous voulez.</p><div class='flex flex-col sm:flex-row gap-4'><a href='https://cms.nextblock.dev' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-white bg-blue-600 hover:bg-blue-700 shadow-lg shadow-blue-500/25 transition-all no-underline'>D&eacute;couvrir la d&eacute;mo &rarr;</a><a href='https://cms.nextblock.dev/sign-in' target='_blank' rel='noopener noreferrer' class='inline-flex items-center justify-center gap-2 rounded-xl px-7 h-12 text-sm font-semibold text-slate-700 dark:text-white border border-slate-300 dark:border-white/20 hover:bg-slate-100 dark:hover:bg-white/10 transition-all no-underline'>Ouvrir le tableau de bord &rarr;</a></div><p class='text-xs text-slate-500 dark:text-slate-400 mt-4'>Identifiants d&eacute;mo <span class='font-mono text-slate-700 dark:text-slate-300'>demo@nextblock.dev</span> / <span class='font-mono text-slate-700 dark:text-slate-300'>password</span> &middot; R&eacute;initialis&eacute; chaque jour</p></div><div class='rounded-3xl overflow-hidden border border-slate-800 bg-slate-900 shadow-xl shadow-slate-900/20 dark:border-white/10 dark:bg-white/5 dark:backdrop-blur-xl'><div class='flex items-center gap-2 px-4 py-3 border-b border-white/10 bg-white/5'><span class='w-3 h-3 rounded-full bg-red-400/70'></span><span class='w-3 h-3 rounded-full bg-yellow-400/70'></span><span class='w-3 h-3 rounded-full bg-green-400/70'></span><span class='ml-3 flex-1 truncate rounded-md bg-black/30 px-3 py-1 text-xs font-mono text-slate-300'>cms.nextblock.dev</span></div><div class='p-6 sm:p-8'><p class='text-sm text-slate-300 mb-5'>Une installation NextBlock&trade; bien vivante &mdash; tout ici est r&eacute;el et cliquable :</p><ul class='space-y-4 text-sm text-slate-200'><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>&Eacute;diteur de blocs complet</strong> : commandes slash et glisser-d&eacute;poser.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Gestion bilingue</strong> du contenu fran&ccedil;ais / anglais.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Une boutique de d&eacute;monstration compl&egrave;te</strong> avec un parcours de paiement complet.</span></li><li class='flex items-start gap-3'><span class='mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-cyan-500/15 text-cyan-300 text-xs'>&#10003;</span><span><strong class='text-white'>Remis &agrave; z&eacute;ro chaque jour</strong> &mdash; toujours un nouveau d&eacute;part.</span></li></ul></div></div></div></div>"}}]]}
45
+ $fr$::jsonb,
46
+ updated_at = now()
47
+ WHERE block_type = 'section'
48
+ AND page_id IS NOT NULL
49
+ AND language_id = v_fr_lang
50
+ AND content::text LIKE '%nb-sandbox-promo%';
51
+ END
52
+ $body$;
@@ -0,0 +1,53 @@
1
+ -- 00000000000025_rebrand_nextblock_dev.sql
2
+ -- Domain rebrand: the retired .ca domain -> nextblock.dev.
3
+ --
4
+ -- Two halves to this change, because two populations need different treatment:
5
+ --
6
+ -- Fresh installs -- migrations 00000000000003_baseline_seed and
7
+ -- 00000000000006/007/009_home_live_demo_promo* were rewritten in place
8
+ -- to seed nextblock.dev directly. Safe to edit despite the append-only
9
+ -- rule: Supabase tracks migration history by version string with no
10
+ -- checksum, so an already-applied file is never re-read or replayed.
11
+ -- Those four are seed/content only -- no schema, no constraints.
12
+ --
13
+ -- Existing installs -- prod, sandbox, and any deployed fork already seeded the old domain
14
+ -- from the pre-rewrite versions of those files. They never replay, so
15
+ -- this migration corrects their data forward.
16
+ --
17
+ -- Both paths converge on nextblock.dev. On a fresh install this migration matches nothing
18
+ -- and is a no-op, which is also what makes it safe to re-run.
19
+ --
20
+ -- Also flips the sandbox demo account address. The account itself is created by
21
+ -- apps/nextblock/app/api/cron/reset-sandbox/route.ts (now 'demo@nextblock.dev'); the legacy
22
+ -- demo account is NOT removed here -- the reset route never deletes auth users and never
23
+ -- truncates public.profiles, so it must be deleted by hand in the Supabase Auth dashboard
24
+ -- or it survives as a working ADMIN.
25
+ --
26
+ -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts excludes any
27
+ -- migration whose filename contains "sandbox" from the sandbox reset bundle.
28
+
29
+ DO $body$
30
+ DECLARE
31
+ -- Assembled from two halves on purpose: it is the one string this rebrand is meant to
32
+ -- erase, and spelling it out here would leave the repo-wide grep with a permanent hit
33
+ -- inside the very migration that removes it. Resolves to the retired domain at runtime.
34
+ legacy_domain constant text := 'nextblock' || '.ca';
35
+ BEGIN
36
+ -- 1. Seeded UI strings (e.g. the "Purchase at ..." link on the sandbox checkout panel).
37
+ UPDATE public.translations
38
+ SET translations = replace(translations::text, legacy_domain, 'nextblock.dev')::jsonb,
39
+ updated_at = now()
40
+ WHERE translations::text LIKE '%' || legacy_domain || '%';
41
+
42
+ -- 2. Page/post content -- the home-page "Live Demo" promo carries the demo login address.
43
+ UPDATE public.blocks
44
+ SET content = replace(content::text, legacy_domain, 'nextblock.dev')::jsonb,
45
+ updated_at = now()
46
+ WHERE content::text LIKE '%' || legacy_domain || '%';
47
+
48
+ -- 3. Site settings -- invoice branding on the sandbox carries the billing address.
49
+ UPDATE public.site_settings
50
+ SET value = replace(value::text, legacy_domain, 'nextblock.dev')::jsonb
51
+ WHERE value::text LIKE '%' || legacy_domain || '%';
52
+ END
53
+ $body$;