tokens
Table: tokens
The tokens table stores device tokens for user authentication and device identification.
Columns
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| username | varchar(50) | NO | Primary key, identifies the user |
| device_id | varchar(45) | NO | Device unique identifier |
| device_model | varchar(45) | YES | Model of the device |
| created_ts | datetime | NO | Timestamp of token creation |
| access_token | varchar(250) | YES | Access token for authentication |
| refresh_token | varchar(250) | YES | Refresh token for renewing access |
Indexes
username_UNIQUE— Unique index onusername
Foreign Key Relations
- None
Usage Notes
- Each user can have one active token entry per device.
- Supports authentication and session management for mobile devices.