@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
- ALTER TABLE "mail"."log" ALTER COLUMN "errors" SET DATA TYPE jsonb USING (
2
- CASE
3
- WHEN "errors" IS NULL THEN '[]'::jsonb
4
- ELSE (
5
- SELECT COALESCE(jsonb_agg(jsonb_build_object('message', err)), '[]'::jsonb)
6
- FROM unnest("errors") AS err
7
- )
8
- END
9
- );--> statement-breakpoint
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[]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.93.176",
3
+ "version": "0.93.177",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"