@nextblock-cms/db 0.16.1 → 0.16.2

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.
Files changed (23) hide show
  1. package/package.json +1 -1
  2. package/supabase/migrations/00000000000003_baseline_seed.sql +468 -468
  3. package/supabase/migrations/00000000000006_home_live_demo_promo.sql +67 -67
  4. package/supabase/migrations/00000000000007_home_live_demo_promo_copy_fix.sql +49 -49
  5. package/supabase/migrations/00000000000009_home_live_demo_promo_contrast.sql +52 -52
  6. package/supabase/migrations/00000000000014_site_themes.sql +254 -254
  7. package/supabase/migrations/00000000000015_scheduled_publishing.sql +43 -43
  8. package/supabase/migrations/00000000000016_product_revisions_and_revision_baseline.sql +310 -310
  9. package/supabase/migrations/00000000000017_cortex_ai_mcp_server.sql +91 -91
  10. package/supabase/migrations/00000000000018_site_scripts.sql +96 -96
  11. package/supabase/migrations/00000000000019_site_script_revisions.sql +85 -85
  12. package/supabase/migrations/00000000000020_updating_article.sql +162 -162
  13. package/supabase/migrations/00000000000021_updating_article_git_merge.sql +91 -91
  14. package/supabase/migrations/00000000000022_updating_article_accuracy.sql +94 -94
  15. package/supabase/migrations/00000000000023_updating_article_layout_not_host.sql +87 -87
  16. package/supabase/migrations/00000000000024_updating_article_newline_fix.sql +70 -70
  17. package/supabase/migrations/00000000000025_rebrand_nextblock_dev.sql +53 -53
  18. package/supabase/migrations/00000000000026_product_inquiries.sql +118 -118
  19. package/supabase/migrations/00000000000027_message_threads.sql +391 -391
  20. package/supabase/migrations/00000000000028_interaction_replies.sql +86 -86
  21. package/supabase/migrations/00000000000029_form_endpoints_default_empty.sql +52 -52
  22. package/supabase/migrations/00000000000030_seo_redirects_and_robots.sql +149 -149
  23. package/supabase/migrations/00000000000031_seo_robots_settings_admin_only.sql +35 -35
@@ -1,87 +1,87 @@
1
- -- 00000000000023_updating_article_layout_not_host.sql
2
- -- Corrects the most misleading claim in the "How Updating NextBlock Works" article
3
- -- (seeded 00000000000020, corrected in 021 and 022): that the automatic GitHub Action is
4
- -- about being deployed on Vercel.
5
- --
6
- -- It is not. The upstream-sync Action merges the NextBlock MONOREPO into the repository,
7
- -- so it only works where the repository IS the monorepo — a Vercel 1-click deploy, a
8
- -- GitHub fork, or a clone. A project scaffolded by `npm create nextblock` is the flattened
9
- -- standalone app (app/, components/, lib/ at the root); merging apps/ + libs/ + nx.json
10
- -- into it would wreck it. Pushing that project to GitHub and deploying it on Vercel does
11
- -- not change its layout, so it is still a `npm run update` install. Docker is orthogonal:
12
- -- it is how you RUN a project, not what shape the repository is.
13
- --
14
- -- Also documents that a merge conflict now holds the migration step back until the
15
- -- conflict is resolved, so the schema never moves ahead of undecided code.
16
- --
17
- -- Targeted, idempotent replace() as in 021/022. Data-only; no schema change.
18
-
19
- DO $body$
20
- DECLARE
21
- v_en_post integer;
22
- v_fr_post integer;
23
- BEGIN
24
- SELECT id INTO v_en_post
25
- FROM public.posts WHERE language_id = 1 AND slug = 'how-updating-works'
26
- ORDER BY id LIMIT 1;
27
-
28
- SELECT id INTO v_fr_post
29
- FROM public.posts WHERE language_id = 2 AND slug = 'comment-fonctionnent-les-mises-a-jour'
30
- ORDER BY id LIMIT 1;
31
-
32
- IF v_en_post IS NOT NULL THEN
33
- UPDATE public.blocks
34
- SET content = jsonb_set(
35
- content,
36
- '{html_content}',
37
- to_jsonb(
38
- replace(
39
- replace(
40
- replace(
41
- content->>'html_content',
42
- -- 1. The section intro: say what actually qualifies.
43
- '<p>This path updates itself. When you deployed, NextBlock created a repository you own; the dashboard&rsquo;s <strong>Connect GitHub</strong> onboarding step installs a workflow into it that runs <strong>every day at midnight UTC</strong> and can also be triggered by hand from your repository&rsquo;s <strong>Actions</strong> tab.</p>',
44
- '<p>This path updates itself. When you deployed, NextBlock created a repository you own; the dashboard&rsquo;s <strong>Connect GitHub</strong> onboarding step installs a workflow into it that runs <strong>every day at midnight UTC</strong> and can also be triggered by hand from your repository&rsquo;s <strong>Actions</strong> tab.</p>\n<div class=''rounded-3xl border border-slate-200 bg-slate-50 p-6 my-8 dark:border-white/10 dark:bg-white/5''>\n <p class=''mt-0 text-xs font-semibold uppercase tracking-[0.22em] text-slate-600 dark:text-slate-300''>What qualifies &mdash; it is the repository, not the host</p>\n <p class=''mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200''>The workflow merges the <strong>NextBlock monorepo</strong> into your repository, so it only works where your repository <em>is</em> that monorepo: a one-click deploy, a GitHub fork, or a clone. A project created with <code>npm create nextblock</code> is the flattened standalone app &mdash; <code>app/</code>, <code>components/</code> and <code>lib/</code> at the root &mdash; and merging <code>apps/</code>, <code>libs/</code> and <code>nx.json</code> into it would wreck it. Pushing that project to GitHub and deploying it on Vercel does not change its shape: it is still an <code>npm run update</code> install, and NextBlock will not offer it this workflow. Docker is a separate question entirely &mdash; that is how you <em>run</em> a project, not what shape its repository is.</p>\n</div>'
45
- ),
46
- -- 2. The FAQ answer, which asked exactly the question this clarifies.
47
- '<h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>\n<p>No. That path is fully automatic. The command exists for when you want an update <em>now</em> rather than at midnight, or when you are working on a local clone.</p>',
48
- '<h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>\n<p>No. That path is fully automatic. The command exists for when you want an update <em>now</em> rather than at midnight, or when you are working on a local clone.</p>\n<h3>I deployed to Vercel, but from <code>npm create nextblock</code>. Is that automatic too?</h3>\n<p>No &mdash; and this is the distinction that catches people out. Automatic updates depend on your repository being the NextBlock <strong>monorepo</strong>, not on where the site is hosted. A project scaffolded by the CLI is the flattened standalone app whatever you deploy it to, so it updates with <code>npm run update</code>. You will not see the <strong>Connect GitHub</strong> step on that kind of install, because the workflow it installs would merge a completely different source tree into yours.</p>'
49
- ),
50
- -- 3. Conflicts hold the schema step.
51
- '<li><strong>A failed migration</strong> rolls back. Fix the cause and re-run; nothing half-applied is left behind.</li>',
52
- '<li><strong>A failed migration</strong> rolls back. Fix the cause and re-run; nothing half-applied is left behind.</li>\n <li><strong>Unresolved conflicts hold the database back.</strong> If a merge left conflicts, the update finishes the code and dependency work but <em>stops before migrating</em> &mdash; your schema never moves ahead of code you have not finished deciding on. Resolve them and run <code>npm run update</code> again to apply the migrations, or walk away with <code>git reset --hard HEAD</code>; either way the database was never touched.</li>'
53
- )
54
- )
55
- ),
56
- updated_at = now()
57
- WHERE post_id = v_en_post
58
- AND block_type = 'text';
59
- END IF;
60
-
61
- IF v_fr_post IS NOT NULL THEN
62
- UPDATE public.blocks
63
- SET content = jsonb_set(
64
- content,
65
- '{html_content}',
66
- to_jsonb(
67
- replace(
68
- replace(
69
- replace(
70
- content->>'html_content',
71
- '<p>Ce chemin se met &agrave; jour tout seul. Lors du d&eacute;ploiement, NextBlock a cr&eacute;&eacute; un d&eacute;p&ocirc;t qui vous appartient ; l''&eacute;tape <strong>Connect GitHub</strong> du tableau de bord y installe un workflow qui s''ex&eacute;cute <strong>chaque jour &agrave; minuit UTC</strong> et peut aussi &ecirc;tre lanc&eacute; &agrave; la demande depuis l''onglet <strong>Actions</strong> de votre d&eacute;p&ocirc;t.</p>',
72
- '<p>Ce chemin se met &agrave; jour tout seul. Lors du d&eacute;ploiement, NextBlock a cr&eacute;&eacute; un d&eacute;p&ocirc;t qui vous appartient ; l''&eacute;tape <strong>Connect GitHub</strong> du tableau de bord y installe un workflow qui s''ex&eacute;cute <strong>chaque jour &agrave; minuit UTC</strong> et peut aussi &ecirc;tre lanc&eacute; &agrave; la demande depuis l''onglet <strong>Actions</strong> de votre d&eacute;p&ocirc;t.</p>\n<div class=''rounded-3xl border border-slate-200 bg-slate-50 p-6 my-8 dark:border-white/10 dark:bg-white/5''>\n <p class=''mt-0 text-xs font-semibold uppercase tracking-[0.22em] text-slate-600 dark:text-slate-300''>Ce qui compte : le d&eacute;p&ocirc;t, pas l''h&eacute;bergeur</p>\n <p class=''mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200''>Le workflow fusionne le <strong>monorepo NextBlock</strong> dans votre d&eacute;p&ocirc;t : il ne fonctionne donc que si votre d&eacute;p&ocirc;t <em>est</em> ce monorepo &mdash; d&eacute;ploiement en un clic, fork GitHub ou clone. Un projet cr&eacute;&eacute; avec <code>npm create nextblock</code> est l''application autonome aplatie &mdash; <code>app/</code>, <code>components/</code> et <code>lib/</code> &agrave; la racine &mdash; et y fusionner <code>apps/</code>, <code>libs/</code> et <code>nx.json</code> le casserait. Pousser ce projet sur GitHub et le d&eacute;ployer sur Vercel ne change pas sa forme : il se met toujours &agrave; jour avec <code>npm run update</code>, et NextBlock ne lui proposera pas ce workflow. Docker est une tout autre question &mdash; c''est la fa&ccedil;on d''<em>ex&eacute;cuter</em> un projet, pas la forme de son d&eacute;p&ocirc;t.</p>\n</div>'
73
- ),
74
- '<h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>\n<p>Non. Ce chemin est enti&egrave;rement automatique. La commande existe pour mettre &agrave; jour <em>tout de suite</em> plut&ocirc;t qu''&agrave; minuit, ou lorsque vous travaillez sur un clone local.</p>',
75
- '<h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>\n<p>Non. Ce chemin est enti&egrave;rement automatique. La commande existe pour mettre &agrave; jour <em>tout de suite</em> plut&ocirc;t qu''&agrave; minuit, ou lorsque vous travaillez sur un clone local.</p>\n<h3>J''ai d&eacute;ploy&eacute; sur Vercel, mais depuis <code>npm create nextblock</code>. Est-ce automatique aussi ?</h3>\n<p>Non &mdash; et c''est la distinction qui pi&egrave;ge le plus. Les mises &agrave; jour automatiques d&eacute;pendent du fait que votre d&eacute;p&ocirc;t soit le <strong>monorepo</strong> NextBlock, pas de l''endroit o&ugrave; le site est h&eacute;berg&eacute;. Un projet g&eacute;n&eacute;r&eacute; par le CLI reste l''application autonome aplatie, quel que soit l''h&eacute;bergeur : il se met &agrave; jour avec <code>npm run update</code>. L''&eacute;tape <strong>Connect GitHub</strong> ne s''affiche pas sur ce type d''installation, car le workflow qu''elle installe fusionnerait une arborescence totalement diff&eacute;rente dans la v&ocirc;tre.</p>'
76
- ),
77
- '<li><strong>Une migration en &eacute;chec</strong> est annul&eacute;e. Corrigez la cause et relancez : rien ne reste &agrave; moiti&eacute; appliqu&eacute;.</li>',
78
- '<li><strong>Une migration en &eacute;chec</strong> est annul&eacute;e. Corrigez la cause et relancez : rien ne reste &agrave; moiti&eacute; appliqu&eacute;.</li>\n <li><strong>Les conflits non r&eacute;solus bloquent la base.</strong> Si une fusion a laiss&eacute; des conflits, la mise &agrave; jour termine le code et les d&eacute;pendances mais <em>s''arr&ecirc;te avant les migrations</em> &mdash; votre sch&eacute;ma ne prend jamais de l''avance sur un code que vous n''avez pas fini d''arbitrer. R&eacute;solvez-les puis relancez <code>npm run update</code> pour appliquer les migrations, ou abandonnez avec <code>git reset --hard HEAD</code> : dans les deux cas la base n''a jamais &eacute;t&eacute; touch&eacute;e.</li>'
79
- )
80
- )
81
- ),
82
- updated_at = now()
83
- WHERE post_id = v_fr_post
84
- AND block_type = 'text';
85
- END IF;
86
- END
87
- $body$;
1
+ -- 00000000000023_updating_article_layout_not_host.sql
2
+ -- Corrects the most misleading claim in the "How Updating NextBlock Works" article
3
+ -- (seeded 00000000000020, corrected in 021 and 022): that the automatic GitHub Action is
4
+ -- about being deployed on Vercel.
5
+ --
6
+ -- It is not. The upstream-sync Action merges the NextBlock MONOREPO into the repository,
7
+ -- so it only works where the repository IS the monorepo — a Vercel 1-click deploy, a
8
+ -- GitHub fork, or a clone. A project scaffolded by `npm create nextblock` is the flattened
9
+ -- standalone app (app/, components/, lib/ at the root); merging apps/ + libs/ + nx.json
10
+ -- into it would wreck it. Pushing that project to GitHub and deploying it on Vercel does
11
+ -- not change its layout, so it is still a `npm run update` install. Docker is orthogonal:
12
+ -- it is how you RUN a project, not what shape the repository is.
13
+ --
14
+ -- Also documents that a merge conflict now holds the migration step back until the
15
+ -- conflict is resolved, so the schema never moves ahead of undecided code.
16
+ --
17
+ -- Targeted, idempotent replace() as in 021/022. Data-only; no schema change.
18
+
19
+ DO $body$
20
+ DECLARE
21
+ v_en_post integer;
22
+ v_fr_post integer;
23
+ BEGIN
24
+ SELECT id INTO v_en_post
25
+ FROM public.posts WHERE language_id = 1 AND slug = 'how-updating-works'
26
+ ORDER BY id LIMIT 1;
27
+
28
+ SELECT id INTO v_fr_post
29
+ FROM public.posts WHERE language_id = 2 AND slug = 'comment-fonctionnent-les-mises-a-jour'
30
+ ORDER BY id LIMIT 1;
31
+
32
+ IF v_en_post IS NOT NULL THEN
33
+ UPDATE public.blocks
34
+ SET content = jsonb_set(
35
+ content,
36
+ '{html_content}',
37
+ to_jsonb(
38
+ replace(
39
+ replace(
40
+ replace(
41
+ content->>'html_content',
42
+ -- 1. The section intro: say what actually qualifies.
43
+ '<p>This path updates itself. When you deployed, NextBlock created a repository you own; the dashboard&rsquo;s <strong>Connect GitHub</strong> onboarding step installs a workflow into it that runs <strong>every day at midnight UTC</strong> and can also be triggered by hand from your repository&rsquo;s <strong>Actions</strong> tab.</p>',
44
+ '<p>This path updates itself. When you deployed, NextBlock created a repository you own; the dashboard&rsquo;s <strong>Connect GitHub</strong> onboarding step installs a workflow into it that runs <strong>every day at midnight UTC</strong> and can also be triggered by hand from your repository&rsquo;s <strong>Actions</strong> tab.</p>\n<div class=''rounded-3xl border border-slate-200 bg-slate-50 p-6 my-8 dark:border-white/10 dark:bg-white/5''>\n <p class=''mt-0 text-xs font-semibold uppercase tracking-[0.22em] text-slate-600 dark:text-slate-300''>What qualifies &mdash; it is the repository, not the host</p>\n <p class=''mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200''>The workflow merges the <strong>NextBlock monorepo</strong> into your repository, so it only works where your repository <em>is</em> that monorepo: a one-click deploy, a GitHub fork, or a clone. A project created with <code>npm create nextblock</code> is the flattened standalone app &mdash; <code>app/</code>, <code>components/</code> and <code>lib/</code> at the root &mdash; and merging <code>apps/</code>, <code>libs/</code> and <code>nx.json</code> into it would wreck it. Pushing that project to GitHub and deploying it on Vercel does not change its shape: it is still an <code>npm run update</code> install, and NextBlock will not offer it this workflow. Docker is a separate question entirely &mdash; that is how you <em>run</em> a project, not what shape its repository is.</p>\n</div>'
45
+ ),
46
+ -- 2. The FAQ answer, which asked exactly the question this clarifies.
47
+ '<h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>\n<p>No. That path is fully automatic. The command exists for when you want an update <em>now</em> rather than at midnight, or when you are working on a local clone.</p>',
48
+ '<h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>\n<p>No. That path is fully automatic. The command exists for when you want an update <em>now</em> rather than at midnight, or when you are working on a local clone.</p>\n<h3>I deployed to Vercel, but from <code>npm create nextblock</code>. Is that automatic too?</h3>\n<p>No &mdash; and this is the distinction that catches people out. Automatic updates depend on your repository being the NextBlock <strong>monorepo</strong>, not on where the site is hosted. A project scaffolded by the CLI is the flattened standalone app whatever you deploy it to, so it updates with <code>npm run update</code>. You will not see the <strong>Connect GitHub</strong> step on that kind of install, because the workflow it installs would merge a completely different source tree into yours.</p>'
49
+ ),
50
+ -- 3. Conflicts hold the schema step.
51
+ '<li><strong>A failed migration</strong> rolls back. Fix the cause and re-run; nothing half-applied is left behind.</li>',
52
+ '<li><strong>A failed migration</strong> rolls back. Fix the cause and re-run; nothing half-applied is left behind.</li>\n <li><strong>Unresolved conflicts hold the database back.</strong> If a merge left conflicts, the update finishes the code and dependency work but <em>stops before migrating</em> &mdash; your schema never moves ahead of code you have not finished deciding on. Resolve them and run <code>npm run update</code> again to apply the migrations, or walk away with <code>git reset --hard HEAD</code>; either way the database was never touched.</li>'
53
+ )
54
+ )
55
+ ),
56
+ updated_at = now()
57
+ WHERE post_id = v_en_post
58
+ AND block_type = 'text';
59
+ END IF;
60
+
61
+ IF v_fr_post IS NOT NULL THEN
62
+ UPDATE public.blocks
63
+ SET content = jsonb_set(
64
+ content,
65
+ '{html_content}',
66
+ to_jsonb(
67
+ replace(
68
+ replace(
69
+ replace(
70
+ content->>'html_content',
71
+ '<p>Ce chemin se met &agrave; jour tout seul. Lors du d&eacute;ploiement, NextBlock a cr&eacute;&eacute; un d&eacute;p&ocirc;t qui vous appartient ; l''&eacute;tape <strong>Connect GitHub</strong> du tableau de bord y installe un workflow qui s''ex&eacute;cute <strong>chaque jour &agrave; minuit UTC</strong> et peut aussi &ecirc;tre lanc&eacute; &agrave; la demande depuis l''onglet <strong>Actions</strong> de votre d&eacute;p&ocirc;t.</p>',
72
+ '<p>Ce chemin se met &agrave; jour tout seul. Lors du d&eacute;ploiement, NextBlock a cr&eacute;&eacute; un d&eacute;p&ocirc;t qui vous appartient ; l''&eacute;tape <strong>Connect GitHub</strong> du tableau de bord y installe un workflow qui s''ex&eacute;cute <strong>chaque jour &agrave; minuit UTC</strong> et peut aussi &ecirc;tre lanc&eacute; &agrave; la demande depuis l''onglet <strong>Actions</strong> de votre d&eacute;p&ocirc;t.</p>\n<div class=''rounded-3xl border border-slate-200 bg-slate-50 p-6 my-8 dark:border-white/10 dark:bg-white/5''>\n <p class=''mt-0 text-xs font-semibold uppercase tracking-[0.22em] text-slate-600 dark:text-slate-300''>Ce qui compte : le d&eacute;p&ocirc;t, pas l''h&eacute;bergeur</p>\n <p class=''mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200''>Le workflow fusionne le <strong>monorepo NextBlock</strong> dans votre d&eacute;p&ocirc;t : il ne fonctionne donc que si votre d&eacute;p&ocirc;t <em>est</em> ce monorepo &mdash; d&eacute;ploiement en un clic, fork GitHub ou clone. Un projet cr&eacute;&eacute; avec <code>npm create nextblock</code> est l''application autonome aplatie &mdash; <code>app/</code>, <code>components/</code> et <code>lib/</code> &agrave; la racine &mdash; et y fusionner <code>apps/</code>, <code>libs/</code> et <code>nx.json</code> le casserait. Pousser ce projet sur GitHub et le d&eacute;ployer sur Vercel ne change pas sa forme : il se met toujours &agrave; jour avec <code>npm run update</code>, et NextBlock ne lui proposera pas ce workflow. Docker est une tout autre question &mdash; c''est la fa&ccedil;on d''<em>ex&eacute;cuter</em> un projet, pas la forme de son d&eacute;p&ocirc;t.</p>\n</div>'
73
+ ),
74
+ '<h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>\n<p>Non. Ce chemin est enti&egrave;rement automatique. La commande existe pour mettre &agrave; jour <em>tout de suite</em> plut&ocirc;t qu''&agrave; minuit, ou lorsque vous travaillez sur un clone local.</p>',
75
+ '<h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>\n<p>Non. Ce chemin est enti&egrave;rement automatique. La commande existe pour mettre &agrave; jour <em>tout de suite</em> plut&ocirc;t qu''&agrave; minuit, ou lorsque vous travaillez sur un clone local.</p>\n<h3>J''ai d&eacute;ploy&eacute; sur Vercel, mais depuis <code>npm create nextblock</code>. Est-ce automatique aussi ?</h3>\n<p>Non &mdash; et c''est la distinction qui pi&egrave;ge le plus. Les mises &agrave; jour automatiques d&eacute;pendent du fait que votre d&eacute;p&ocirc;t soit le <strong>monorepo</strong> NextBlock, pas de l''endroit o&ugrave; le site est h&eacute;berg&eacute;. Un projet g&eacute;n&eacute;r&eacute; par le CLI reste l''application autonome aplatie, quel que soit l''h&eacute;bergeur : il se met &agrave; jour avec <code>npm run update</code>. L''&eacute;tape <strong>Connect GitHub</strong> ne s''affiche pas sur ce type d''installation, car le workflow qu''elle installe fusionnerait une arborescence totalement diff&eacute;rente dans la v&ocirc;tre.</p>'
76
+ ),
77
+ '<li><strong>Une migration en &eacute;chec</strong> est annul&eacute;e. Corrigez la cause et relancez : rien ne reste &agrave; moiti&eacute; appliqu&eacute;.</li>',
78
+ '<li><strong>Une migration en &eacute;chec</strong> est annul&eacute;e. Corrigez la cause et relancez : rien ne reste &agrave; moiti&eacute; appliqu&eacute;.</li>\n <li><strong>Les conflits non r&eacute;solus bloquent la base.</strong> Si une fusion a laiss&eacute; des conflits, la mise &agrave; jour termine le code et les d&eacute;pendances mais <em>s''arr&ecirc;te avant les migrations</em> &mdash; votre sch&eacute;ma ne prend jamais de l''avance sur un code que vous n''avez pas fini d''arbitrer. R&eacute;solvez-les puis relancez <code>npm run update</code> pour appliquer les migrations, ou abandonnez avec <code>git reset --hard HEAD</code> : dans les deux cas la base n''a jamais &eacute;t&eacute; touch&eacute;e.</li>'
79
+ )
80
+ )
81
+ ),
82
+ updated_at = now()
83
+ WHERE post_id = v_fr_post
84
+ AND block_type = 'text';
85
+ END IF;
86
+ END
87
+ $body$;
@@ -1,70 +1,70 @@
1
- -- 00000000000024_updating_article_newline_fix.sql
2
- -- Repairs two mistakes made by 00000000000023 in the "How Updating NextBlock Works"
3
- -- article, and lands the FAQ entry that migration failed to insert.
4
- --
5
- -- 1. RENDERING BUG. 023 wrote `\n` inside ordinary single-quoted SQL literals. With
6
- -- standard_conforming_strings on (the default), that is a literal backslash followed
7
- -- by 'n' — not a newline — so five visible "\n" sequences were stored in the article
8
- -- body. Replaced here with real newlines via chr(10). Idempotent: once none remain,
9
- -- replace() is a no-op.
10
- --
11
- -- 2. SILENT NO-MATCH. 023's FAQ replacement targeted a string spanning `</h3>\n<p>`, and
12
- -- for the same reason the literal never matched the real newline in the stored HTML, so
13
- -- the replacement quietly did nothing. Redone here by anchoring on the single-line <h3>
14
- -- alone and prepending the new entry — no newline in either the search or the
15
- -- replacement, which is the rule this file establishes for editing the article.
16
- --
17
- -- Data-only; no schema change.
18
-
19
- DO $body$
20
- DECLARE
21
- v_en_post integer;
22
- v_fr_post integer;
23
- BEGIN
24
- SELECT id INTO v_en_post
25
- FROM public.posts WHERE language_id = 1 AND slug = 'how-updating-works'
26
- ORDER BY id LIMIT 1;
27
-
28
- SELECT id INTO v_fr_post
29
- FROM public.posts WHERE language_id = 2 AND slug = 'comment-fonctionnent-les-mises-a-jour'
30
- ORDER BY id LIMIT 1;
31
-
32
- IF v_en_post IS NOT NULL THEN
33
- UPDATE public.blocks
34
- SET content = jsonb_set(
35
- content,
36
- '{html_content}',
37
- to_jsonb(
38
- replace(
39
- -- (1) literal backslash-n -> real newline
40
- replace(content->>'html_content', E'\\n', chr(10)),
41
- -- (2) the FAQ entry 023 failed to insert
42
- '<h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>',
43
- '<h3>I deployed to Vercel, but from <code>npm create nextblock</code>. Is that automatic too?</h3><p>No &mdash; and this is the distinction that catches people out. Automatic updates depend on your repository being the NextBlock <strong>monorepo</strong>, not on where the site is hosted. A project scaffolded by the CLI is the flattened standalone app whatever you deploy it to, so it updates with <code>npm run update</code>. You will not see the <strong>Connect GitHub</strong> step on that kind of install, because the workflow it installs would merge a completely different source tree into yours.</p><h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>'
44
- )
45
- )
46
- ),
47
- updated_at = now()
48
- WHERE post_id = v_en_post
49
- AND block_type = 'text';
50
- END IF;
51
-
52
- IF v_fr_post IS NOT NULL THEN
53
- UPDATE public.blocks
54
- SET content = jsonb_set(
55
- content,
56
- '{html_content}',
57
- to_jsonb(
58
- replace(
59
- replace(content->>'html_content', E'\\n', chr(10)),
60
- '<h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>',
61
- '<h3>J''ai d&eacute;ploy&eacute; sur Vercel, mais depuis <code>npm create nextblock</code>. Est-ce automatique aussi ?</h3><p>Non &mdash; et c''est la distinction qui pi&egrave;ge le plus. Les mises &agrave; jour automatiques d&eacute;pendent du fait que votre d&eacute;p&ocirc;t soit le <strong>monorepo</strong> NextBlock, pas de l''endroit o&ugrave; le site est h&eacute;berg&eacute;. Un projet g&eacute;n&eacute;r&eacute; par le CLI reste l''application autonome aplatie, quel que soit l''h&eacute;bergeur : il se met &agrave; jour avec <code>npm run update</code>. L''&eacute;tape <strong>Connect GitHub</strong> ne s''affiche pas sur ce type d''installation, car le workflow qu''elle installe fusionnerait une arborescence totalement diff&eacute;rente dans la v&ocirc;tre.</p><h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>'
62
- )
63
- )
64
- ),
65
- updated_at = now()
66
- WHERE post_id = v_fr_post
67
- AND block_type = 'text';
68
- END IF;
69
- END
70
- $body$;
1
+ -- 00000000000024_updating_article_newline_fix.sql
2
+ -- Repairs two mistakes made by 00000000000023 in the "How Updating NextBlock Works"
3
+ -- article, and lands the FAQ entry that migration failed to insert.
4
+ --
5
+ -- 1. RENDERING BUG. 023 wrote `\n` inside ordinary single-quoted SQL literals. With
6
+ -- standard_conforming_strings on (the default), that is a literal backslash followed
7
+ -- by 'n' — not a newline — so five visible "\n" sequences were stored in the article
8
+ -- body. Replaced here with real newlines via chr(10). Idempotent: once none remain,
9
+ -- replace() is a no-op.
10
+ --
11
+ -- 2. SILENT NO-MATCH. 023's FAQ replacement targeted a string spanning `</h3>\n<p>`, and
12
+ -- for the same reason the literal never matched the real newline in the stored HTML, so
13
+ -- the replacement quietly did nothing. Redone here by anchoring on the single-line <h3>
14
+ -- alone and prepending the new entry — no newline in either the search or the
15
+ -- replacement, which is the rule this file establishes for editing the article.
16
+ --
17
+ -- Data-only; no schema change.
18
+
19
+ DO $body$
20
+ DECLARE
21
+ v_en_post integer;
22
+ v_fr_post integer;
23
+ BEGIN
24
+ SELECT id INTO v_en_post
25
+ FROM public.posts WHERE language_id = 1 AND slug = 'how-updating-works'
26
+ ORDER BY id LIMIT 1;
27
+
28
+ SELECT id INTO v_fr_post
29
+ FROM public.posts WHERE language_id = 2 AND slug = 'comment-fonctionnent-les-mises-a-jour'
30
+ ORDER BY id LIMIT 1;
31
+
32
+ IF v_en_post IS NOT NULL THEN
33
+ UPDATE public.blocks
34
+ SET content = jsonb_set(
35
+ content,
36
+ '{html_content}',
37
+ to_jsonb(
38
+ replace(
39
+ -- (1) literal backslash-n -> real newline
40
+ replace(content->>'html_content', E'\\n', chr(10)),
41
+ -- (2) the FAQ entry 023 failed to insert
42
+ '<h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>',
43
+ '<h3>I deployed to Vercel, but from <code>npm create nextblock</code>. Is that automatic too?</h3><p>No &mdash; and this is the distinction that catches people out. Automatic updates depend on your repository being the NextBlock <strong>monorepo</strong>, not on where the site is hosted. A project scaffolded by the CLI is the flattened standalone app whatever you deploy it to, so it updates with <code>npm run update</code>. You will not see the <strong>Connect GitHub</strong> step on that kind of install, because the workflow it installs would merge a completely different source tree into yours.</p><h3>I am on the one-click Vercel deploy &mdash; do I need to run anything?</h3>'
44
+ )
45
+ )
46
+ ),
47
+ updated_at = now()
48
+ WHERE post_id = v_en_post
49
+ AND block_type = 'text';
50
+ END IF;
51
+
52
+ IF v_fr_post IS NOT NULL THEN
53
+ UPDATE public.blocks
54
+ SET content = jsonb_set(
55
+ content,
56
+ '{html_content}',
57
+ to_jsonb(
58
+ replace(
59
+ replace(content->>'html_content', E'\\n', chr(10)),
60
+ '<h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>',
61
+ '<h3>J''ai d&eacute;ploy&eacute; sur Vercel, mais depuis <code>npm create nextblock</code>. Est-ce automatique aussi ?</h3><p>Non &mdash; et c''est la distinction qui pi&egrave;ge le plus. Les mises &agrave; jour automatiques d&eacute;pendent du fait que votre d&eacute;p&ocirc;t soit le <strong>monorepo</strong> NextBlock, pas de l''endroit o&ugrave; le site est h&eacute;berg&eacute;. Un projet g&eacute;n&eacute;r&eacute; par le CLI reste l''application autonome aplatie, quel que soit l''h&eacute;bergeur : il se met &agrave; jour avec <code>npm run update</code>. L''&eacute;tape <strong>Connect GitHub</strong> ne s''affiche pas sur ce type d''installation, car le workflow qu''elle installe fusionnerait une arborescence totalement diff&eacute;rente dans la v&ocirc;tre.</p><h3>Je suis sur le d&eacute;ploiement Vercel en un clic &mdash; dois-je lancer quelque chose ?</h3>'
62
+ )
63
+ )
64
+ ),
65
+ updated_at = now()
66
+ WHERE post_id = v_fr_post
67
+ AND block_type = 'text';
68
+ END IF;
69
+ END
70
+ $body$;
@@ -1,53 +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$;
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$;