@nextblock-cms/db 0.17.0 → 0.17.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 (47) hide show
  1. package/package.json +1 -1
  2. package/supabase/migrations/02000_catchup_gen1.sql +5880 -0
  3. package/supabase/migrations/{00000000000000_baseline_schema.sql → 02001_baseline_schema.sql} +305 -25
  4. package/supabase/migrations/{00000000000001_baseline_constraints_and_indexes.sql → 02002_baseline_constraints_and_indexes.sql} +194 -3
  5. package/supabase/migrations/{00000000000002_baseline_security_and_grants.sql → 02003_baseline_security_and_grants.sql} +403 -161
  6. package/supabase/migrations/02004_baseline_seed.sql +565 -0
  7. package/supabase/migrations/02005_home_live_demo_promo_cadence_15min.sql +53 -0
  8. package/supabase/migrations/00000000000003_baseline_seed.sql +0 -468
  9. package/supabase/migrations/00000000000004_default_logo_email_safe.sql +0 -24
  10. package/supabase/migrations/00000000000005_add_custom_canonical.sql +0 -13
  11. package/supabase/migrations/00000000000006_home_live_demo_promo.sql +0 -67
  12. package/supabase/migrations/00000000000007_home_live_demo_promo_copy_fix.sql +0 -49
  13. package/supabase/migrations/00000000000008_setup_article_reorder.sql +0 -30
  14. package/supabase/migrations/00000000000009_home_live_demo_promo_contrast.sql +0 -52
  15. package/supabase/migrations/00000000000010_drop_github_username.sql +0 -79
  16. package/supabase/migrations/00000000000011_language_detection_admin_only.sql +0 -21
  17. package/supabase/migrations/00000000000012_cortex_ai_stock_photo_settings.sql +0 -25
  18. package/supabase/migrations/00000000000013_youtube_nocookie_embeds.sql +0 -136
  19. package/supabase/migrations/00000000000014_site_themes.sql +0 -254
  20. package/supabase/migrations/00000000000015_scheduled_publishing.sql +0 -43
  21. package/supabase/migrations/00000000000016_product_revisions_and_revision_baseline.sql +0 -310
  22. package/supabase/migrations/00000000000017_cortex_ai_mcp_server.sql +0 -91
  23. package/supabase/migrations/00000000000018_site_scripts.sql +0 -96
  24. package/supabase/migrations/00000000000019_site_script_revisions.sql +0 -85
  25. package/supabase/migrations/00000000000020_updating_article.sql +0 -162
  26. package/supabase/migrations/00000000000021_updating_article_git_merge.sql +0 -91
  27. package/supabase/migrations/00000000000022_updating_article_accuracy.sql +0 -94
  28. package/supabase/migrations/00000000000023_updating_article_layout_not_host.sql +0 -87
  29. package/supabase/migrations/00000000000024_updating_article_newline_fix.sql +0 -70
  30. package/supabase/migrations/00000000000025_rebrand_nextblock_dev.sql +0 -53
  31. package/supabase/migrations/00000000000026_product_inquiries.sql +0 -118
  32. package/supabase/migrations/00000000000027_message_threads.sql +0 -391
  33. package/supabase/migrations/00000000000028_interaction_replies.sql +0 -86
  34. package/supabase/migrations/00000000000029_form_endpoints_default_empty.sql +0 -52
  35. package/supabase/migrations/00000000000030_seo_redirects_and_robots.sql +0 -149
  36. package/supabase/migrations/00000000000031_seo_robots_settings_admin_only.sql +0 -35
  37. package/supabase/migrations/00000000000032_seed_seo_score_optimizations.sql +0 -1172
  38. package/supabase/migrations/00000000000033_seed_seo_score_optimizations_p2.sql +0 -353
  39. package/supabase/migrations/00000000000034_seed_seo_french_legal_readability.sql +0 -101
  40. package/supabase/migrations/00000000000035_digital_products_seo_optimizations.sql +0 -134
  41. package/supabase/migrations/00000000000036_seed_posts_missing_seo_metadata.sql +0 -37
  42. package/supabase/migrations/00000000000037_reposition_marketing_and_cortex_mcp.sql +0 -501
  43. package/supabase/migrations/00000000000038_mcp_guide_visual_refresh.sql +0 -64
  44. package/supabase/migrations/00000000000039_mcp_guide_diagram_dimensions.sql +0 -21
  45. package/supabase/migrations/00000000000040_home_comparison_chart_free_cms.sql +0 -81
  46. package/supabase/migrations/00000000000041_marketing_review_free_cms_trial.sql +0 -141
  47. package/supabase/migrations/00000000000042_how_nextblock_works_css_diagram.sql +0 -66
@@ -0,0 +1,53 @@
1
+ -- 02005: home "Live Demo" promo copy -- reset cadence "daily" -> "every 15 minutes".
2
+ --
3
+ -- cms.nextblock.dev now runs on Vercel Pro and its reset cron in vercel.json is
4
+ -- */15 * * * * (was 0 3 * * *, daily). The promo section on the EN ('home') and FR
5
+ -- ('accueil') home pages still advertises a daily reset; it already shipped through
6
+ -- 02000 (catch-up) / 02004 (baseline) and lives on real installs, so per the append-only
7
+ -- rule this is a forward-only data fix instead of an edit to those files.
8
+ --
9
+ -- Targets the promo by its nb-sandbox-promo sentinel + parent page (never blocks.id:
10
+ -- ids drift on every install) and rewrites only the six cadence phrases (EN + FR) with
11
+ -- replace(), leaving the rest of the block untouched. page_revisions rows carrying the
12
+ -- sentinel get the same rewrite so restoring a seeded revision cannot bring the "daily"
13
+ -- copy back. Idempotent: a second run matches zero rows (content already equals the
14
+ -- rewritten text). On the sandbox the promo is still stripped afterward by
15
+ -- removeSandboxPromoSections in the reset-sandbox route.
16
+ --
17
+ -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts
18
+ -- excludes any migration whose filename contains "sandbox" from the reset bundle.
19
+
20
+ CREATE OR REPLACE FUNCTION pg_temp.nb_promo_cadence_15min(src text)
21
+ RETURNS text
22
+ LANGUAGE sql
23
+ IMMUTABLE
24
+ AS $fn$
25
+ SELECT replace(replace(replace(replace(replace(replace(src,
26
+ 'It resets daily, so explore',
27
+ 'It resets every 15 minutes, so explore'),
28
+ '&middot; Resets daily</p>',
29
+ '&middot; Resets every 15 minutes</p>'),
30
+ 'Wipes clean daily</strong>',
31
+ 'Wipes clean every 15 minutes</strong>'),
32
+ 'Il se r&eacute;initialise chaque jour :',
33
+ 'Il se r&eacute;initialise toutes les 15 minutes :'),
34
+ 'R&eacute;initialis&eacute; chaque jour</p>',
35
+ 'R&eacute;initialis&eacute; toutes les 15 minutes</p>'),
36
+ 'Remis &agrave; z&eacute;ro chaque jour</strong>',
37
+ 'Remis &agrave; z&eacute;ro toutes les 15 minutes</strong>')
38
+ $fn$;
39
+
40
+ UPDATE public.blocks
41
+ SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb,
42
+ updated_at = now()
43
+ WHERE block_type = 'section'
44
+ AND page_id IS NOT NULL
45
+ AND content::text LIKE '%nb-sandbox-promo%'
46
+ AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
47
+
48
+ UPDATE public.page_revisions
49
+ SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb
50
+ WHERE content::text LIKE '%nb-sandbox-promo%'
51
+ AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
52
+
53
+ DROP FUNCTION IF EXISTS pg_temp.nb_promo_cadence_15min(text);