Only apply the trigger on rows without the id_token_claims set

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Quentin Gliech
2025-07-09 14:55:02 +02:00
committed by GitHub
parent d625aaf530
commit 8b2da5b291

View File

@@ -46,6 +46,7 @@ $$ LANGUAGE plpgsql;
CREATE TRIGGER trg_fill_id_token_claims
BEFORE INSERT OR UPDATE ON upstream_oauth_authorization_sessions
FOR EACH ROW
WHEN (NEW.id_token_claims IS NULL AND NEW.id_token IS NOT NULL AND NEW.id_token <> '')
EXECUTE FUNCTION fill_id_token_claims();
-- This backfills the id_token_claims column in the upstream_oauth_authorization_sessions table