mirror of https://github.com/coder/coder.git
chore: fix down migration 196 (#13006)
It didn't account for null values.
This commit is contained in:
parent
319fd5bf1d
commit
3aa0d73811
|
@ -11,11 +11,15 @@ CREATE OR REPLACE FUNCTION revert_migrate_external_auth_providers_to_jsonb(jsonb
|
||||||
DECLARE
|
DECLARE
|
||||||
result text[];
|
result text[];
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT
|
IF jsonb_typeof($1) = 'null' THEN
|
||||||
array_agg(id::text) INTO result
|
result := '{}';
|
||||||
FROM (
|
ELSE
|
||||||
SELECT
|
SELECT
|
||||||
jsonb_array_elements($1) ->> 'id' AS id) AS external_auth_provider_ids;
|
array_agg(id::text) INTO result
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
jsonb_array_elements($1) ->> 'id' AS id) AS external_auth_provider_ids;
|
||||||
|
END IF;
|
||||||
RETURN result;
|
RETURN result;
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|
Loading…
Reference in New Issue