Skip to main content

tokens

Table: tokens

The tokens table stores device tokens for user authentication and device identification.

Columns

Column NameData TypeConstraintsDescription
usernamevarchar(50)NOPrimary key, identifies the user
device_idvarchar(45)NODevice unique identifier
device_modelvarchar(45)YESModel of the device
created_tsdatetimeNOTimestamp of token creation
access_tokenvarchar(250)YESAccess token for authentication
refresh_tokenvarchar(250)YESRefresh token for renewing access

Indexes

  • username_UNIQUE — Unique index on username

Foreign Key Relations

  • None

Usage Notes

  • Each user can have one active token entry per device.
  • Supports authentication and session management for mobile devices.