@tstdl/base 0.93.176 → 0.93.177
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.
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
1
|
+
CREATE OR REPLACE FUNCTION mail.map_errors_to_jsonb(text_array text[])
|
|
2
|
+
RETURNS jsonb AS $$
|
|
3
|
+
SELECT COALESCE(jsonb_agg(jsonb_build_object('message', err)), '[]'::jsonb)
|
|
4
|
+
FROM unnest(text_array) AS err;
|
|
5
|
+
$$ LANGUAGE sql IMMUTABLE;
|
|
6
|
+
|
|
7
|
+
ALTER TABLE "mail"."log"
|
|
8
|
+
ALTER COLUMN "errors" SET DATA TYPE jsonb
|
|
9
|
+
USING mail.map_errors_to_jsonb("errors");
|
|
10
|
+
|
|
10
11
|
ALTER TABLE "mail"."log" ALTER COLUMN "errors" SET NOT NULL;
|
|
12
|
+
DROP FUNCTION mail.map_errors_to_jsonb(text[]);
|