Yuki UIYuki UI

Database

Auth requires the following database tables to work:

Core Schema

User

Table name: user

FieldTypeKeyDesccription
iduuidPKUnique identifier for the user
namevarchar(255)User's name
emailvarchar(255)User's email address for login
imagevarchar(255)User's image url
created_attimestampTimestamp when the user was created.
updated_attimestampTimestamp when the user was last updated.

Account

Table name: account

FieldTypeKeyDesccription
providervarchar(255)PKProvider name (e.g. 'google', 'github')
account_idvarchar(255)PKUnique identifier for the account
user_iduuidFKForeign key referencing the user table
passwordvarchar(255)?Hashed password (only used with credential provider)

Session

Table name: session

FieldTypeKeyDesccription
tokenvarchar(255)PKUnique session token
expirestimestampExpiration date of the session
user_iduuidFKForeign key referencing the user table

Relationships

The database schema establishes the following relationships between tables:

  • User to Account: One-to-many relationship. A user can have multiple accounts across different providers.
  • User to Session: One-to-many relationship. A user can have multiple active sessions.
  • Account to User: Many-to-one relationship. Each account belongs to exactly one user.
  • Session to User: Many-to-one relationship. Each session belongs to exactly one user.