waveterm/db/migrations-wstore/000005_blockparent.up.sql

5 lines
181 B
MySQL
Raw Normal View History

2024-10-24 07:47:29 +02:00
UPDATE db_block
SET data = json_set(db_block.data, '$.parentoref', 'tab:' || db_tab.oid)
FROM db_tab
WHERE db_block.oid IN (SELECT value FROM json_each(db_tab.data, '$.blockids'));