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.
id uuid gen_random_uuid() false Stable identifier of the grant, used to revoke it and in audit logs. A new grant after a revoke gets a new id.
last_used_at timestamp with time zone true When an access token from this grant was last used, at minute resolution. Shown with the grant on the user’s account page.
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.

Viewpoints

Name Definition
AI agent changesets How a teacher’s AI agent edits course material through the MCP server without touching what students see. Every agent write is staged in the teacher’s open changeset for the course and reaches students only when the changeset is published; each call is logged with what it changed so that it can be reverted, and saves from the web UI and agents alike leave history.

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_id_key UNIQUE UNIQUE (id)
oauth_user_client_scopes_id_not_null n NOT NULL id
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.
oauth_user_client_scopes_id_key CREATE UNIQUE INDEX oauth_user_client_scopes_id_key ON public.oauth_user_client_scopes USING btree (id)
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