Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3aa0d73

Browse files
authored
chore: fix down migration 196 (#13006)
It didn't account for null values.
1 parent319fd5b commit3aa0d73

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎coderd/database/migrations/000196_external_auth_providers_jsonb.down.sql

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ CREATE OR REPLACE FUNCTION revert_migrate_external_auth_providers_to_jsonb(jsonb
1111
DECLARE
1212
resulttext[];
1313
BEGIN
14-
SELECT
15-
array_agg(id::text) INTO result
16-
FROM (
17-
SELECT
18-
jsonb_array_elements($1)->>'id'AS id)AS external_auth_provider_ids;
14+
IF jsonb_typeof($1)='null' THEN
15+
result :='{}';
16+
ELSE
17+
SELECT
18+
array_agg(id::text) INTO result
19+
FROM (
20+
SELECT
21+
jsonb_array_elements($1)->>'id'AS id)AS external_auth_provider_ids;
22+
END IF;
1923
RETURN result;
2024
END;
2125
$$;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp