erDiagram
USERS ||--o{ AUTHOR : has
USERS ||--o{ OAUTH_TOKENS : has
USERS ||--|| USER_SETTINGS : has
USERS {
UUID id PK
string email
string password_hash
boolean email_verified
string email_token
boolean requires_2fa
datetime created_at
datetime updated_at
string role
string google_id
string provider
string profile_image
string locale
}
AUTHOR {
UUID id PK
UUID user_id FK
string pen_name
string biography
}
BOOK {
UUID id PK
UUID author_id FK
string title
datetime published_at
}
OAUTH_TOKENS {
UUID id PK
UUID user_id FK
string access_token
string refresh_token
string provider
datetime expires_at
datetime created_at
}
USER_SETTINGS {
UUID id PK
UUID user_id FK
string theme
boolean notifications
datetime created_at
datetime updated_at
}