oauth_access_tokens table

The oauth_access_tokens table in the Reddit Clone Database Schema schema has 9 columns, keyed by id, with 2 foreign keys to oauth_applications and users.

user_id null is an application-only token with no human behind it, which is exactly the case rate limiting has to treat differently.

Columns (9)

Columns of the oauth_access_tokens table
ColumnTypeConstraintsDescription
iduuidprimary key
application_iduuidnot null, references oauth_applications.id
user_iduuidreferences users.id
token_hashvarchar(255)unique, not null
refresh_token_hashvarchar(255)
scopesvarchar(500)not null
issued_attimestamptznot null
expires_attimestamptznot null
revoked_attimestamptz

Indexes (2)

  • (application_id, user_id)
  • (user_id, revoked_at)

Relationships