@commonpub/schema 0.14.1 → 0.14.3

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.
@@ -0,0 +1,14 @@
1
+ -- Fix docs_pages.content rows that were double-stringified by the pre-session-129
2
+ -- createDocsPage / updateDocsPage bug. Those rows are stored as a jsonb STRING
3
+ -- whose VALUE is the JSON text of a BlockTuple array; we unwrap to a proper
4
+ -- jsonb ARRAY so SQL that uses jsonb_typeof / jsonb_array_elements can reach
5
+ -- the block contents (docs search especially).
6
+ --
7
+ -- Rows where content is a genuine legacy-markdown string (doesn't start with
8
+ -- '[' or '{') are left alone — they're intentional strings for the markdown
9
+ -- renderer path.
10
+
11
+ UPDATE docs_pages
12
+ SET content = (content #>> '{}')::jsonb
13
+ WHERE jsonb_typeof(content) = 'string'
14
+ AND substr(content #>> '{}', 1, 1) IN ('[', '{');