Skip to content

Commit 81efccf

Browse files
sandhoseCopilot
andauthored
Only apply the trigger on rows without the id_token_claims set
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9644a2b commit 81efccf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/storage-pg/migrations/20250709142230_backfill_id_token_claims.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ $$ LANGUAGE plpgsql;
4646
CREATE TRIGGER trg_fill_id_token_claims
4747
BEFORE INSERT OR UPDATE ON upstream_oauth_authorization_sessions
4848
FOR EACH ROW
49+
WHEN (NEW.id_token_claims IS NULL AND NEW.id_token IS NOT NULL AND NEW.id_token <> '')
4950
EXECUTE FUNCTION fill_id_token_claims();
5051

5152
-- This backfills the id_token_claims column in the upstream_oauth_authorization_sessions table

0 commit comments

Comments
 (0)