Docs are not available for mobile use. Please use a desktop computer to view the documentation.
Users
Core user profiles and account information
Purpose
The users
table stores core user profile information and account details. This is the central table that all other user-specific data references through foreign keys.
Schema Definition
Field | Type | Description | Constraints |
---|---|---|---|
id | uuid | Unique identifier for the user | Primary key, auto-generated |
firstName | varchar | User’s first name | Not null |
lastName | varchar | User’s last name | Not null |
email | varchar | User’s email address | Not null, unique |
timezone | varchar(50) | User’s timezone | Default: ‘America/Los_Angeles’ |
createdAt | timestamptz | When the user account was created | Auto-generated, not null |
updatedAt | timestamptz | When the user account was last updated | Auto-updated, not null |
Relationships
This table is referenced by:
sources.userId
- User’s data sourcessignals.userId
- User’s configured signalsambient_signals.userId
- User’s ambient signal dataepisodic_signals.userId
- User’s episodic signal datasignal_boundaries.userId
- User’s detected signal boundariesboundary_detections.userId
- User’s boundary detection resultsboundary_detection_runs.userId
- User’s detection run history
Indexes
users_email_idx
- B-tree index on email for fast lookupsusers_email_unique
- Unique constraint on email
Constraints
- Email must be unique across all users
- First and last names are required
- Timezone defaults to Pacific Time if not specified
Usage Examples
Find user by email
SELECT * FROM users WHERE email = 'user@example.com';
Get user creation info
SELECT firstName, lastName, email, createdAt
FROM users
WHERE id = 'user-uuid';
Update user timezone
UPDATE users
SET timezone = 'America/New_York', updatedAt = NOW()
WHERE id = 'user-uuid';