Index

public.oauth_user_client_scopes

Description

Stores remembered consent: which scopes a user has granted to a client.

Columns

Name Type Default Nullable Children Parents Comment
client_id uuid false public.oauth_clients Client to which consent applies.
granted_at timestamp with time zone now() false When the consent was initially granted.
scopes text[] ‘{}’::text[] false Scopes remembered for this user-client pair.
updated_at timestamp with time zone now() false Last time consent set was updated (maintained by trigger).
user_id uuid false public.users User who granted consent.

Constraints

Name Type Definition
oauth_user_client_scopes_client_id_fkey FOREIGN KEY FOREIGN KEY (client_id) REFERENCES oauth_clients(id) ON DELETE CASCADE
oauth_user_client_scopes_client_id_not_null n NOT NULL client_id
oauth_user_client_scopes_granted_at_not_null n NOT NULL granted_at
oauth_user_client_scopes_pkey PRIMARY KEY PRIMARY KEY (user_id, client_id)
oauth_user_client_scopes_scopes_not_null n NOT NULL scopes
oauth_user_client_scopes_updated_at_not_null n NOT NULL updated_at
oauth_user_client_scopes_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
oauth_user_client_scopes_user_id_not_null n NOT NULL user_id
scopes_token_chars CHECK CHECK (scopes_all_valid(scopes))

Indexes

Name Definition Comment
idx_oauth_user_client_scopes_client CREATE INDEX idx_oauth_user_client_scopes_client ON public.oauth_user_client_scopes USING btree (client_id) Speeds queries by client across remembered consents.
idx_oauth_user_client_scopes_user CREATE INDEX idx_oauth_user_client_scopes_user ON public.oauth_user_client_scopes USING btree (user_id) Speeds queries by user across remembered consents.
oauth_user_client_scopes_pkey CREATE UNIQUE INDEX oauth_user_client_scopes_pkey ON public.oauth_user_client_scopes USING btree (user_id, client_id)

Triggers

Name Definition
set_timestamp_oauth_user_client_scopes CREATE TRIGGER set_timestamp_oauth_user_client_scopes BEFORE UPDATE ON public.oauth_user_client_scopes FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls