oauth_applications table

The oauth_applications table in the Reddit Clone Database Schema schema has 10 columns, keyed by id, with 1 foreign key to users. 1 column in oauth_access_tokens references it.

client_secret_hash is nullable because an installed app cannot keep a secret and must use PKCE instead. Modelling that as a nullable column rather than pretending every client is confidential is the whole point of app_type.

Columns (10)

Columns of the oauth_applications table
ColumnTypeConstraintsDescription
iduuidprimary key
owner_iduuidnot null, references users.id
namevarchar(100)not null
descriptionvarchar(500)
app_typeoauth_app_typenot null
client_idvarchar(64)unique, not null
client_secret_hashvarchar(255)
redirect_urivarchar(500)
is_approvedbooleannot null
created_attimestamptznot null

Indexes (1)

  • (owner_id)

Relationships