feat: redesign match play and add broadcast tooling
This commit is contained in:
15
scripts/migrations/0007-jsonb-repair.sql
Normal file
15
scripts/migrations/0007-jsonb-repair.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Drizzle's jsonb with Bun.SQL stored objects as JSON strings ("{\"a\":1}")
|
||||
-- until src/lib/server/db/jsonb.ts. Turn those strings back into objects.
|
||||
DO $$
|
||||
DECLARE r record;
|
||||
BEGIN
|
||||
FOR r IN
|
||||
SELECT table_name, column_name FROM information_schema.columns
|
||||
WHERE table_schema = 'public' AND data_type = 'jsonb'
|
||||
LOOP
|
||||
EXECUTE format(
|
||||
'UPDATE %I SET %I = (%I #>> ''{}'')::jsonb WHERE jsonb_typeof(%I) = ''string'' AND left(%I #>> ''{}'', 1) IN (''{'', ''['')',
|
||||
r.table_name, r.column_name, r.column_name, r.column_name, r.column_name
|
||||
);
|
||||
END LOOP;
|
||||
END $$;
|
||||
Reference in New Issue
Block a user