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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| owner_id | uuid | not null, references users.id | |
| name | varchar(100) | not null | |
| description | varchar(500) | ||
| app_type | oauth_app_type | not null | |
| client_id | varchar(64) | unique, not null | |
| client_secret_hash | varchar(255) | ||
| redirect_uri | varchar(500) | ||
| is_approved | boolean | not null | |
| created_at | timestamptz | not null |
Indexes (1)
(owner_id)
Relationships
oauth_applications.owner_idreferencesusers.idoauth_access_tokens.application_idreferencesoauth_applications