FocusTime
Tables (18)
announcements
- id — BIGINT — NOT NULL
- title — VARCHAR(255) — NOT NULL
- body — TEXT
- author_id — BIGINT — Foreign key → users.id
- status — VARCHAR(20) — NOT NULL
- published_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
blocks
- blocker_id — BIGINT — Foreign key → users.id — NOT NULL
- blocked_id — BIGINT — Foreign key → users.id — NOT NULL
- created_at — DATETIME(6) — NOT NULL
faqs
- id — BIGINT — NOT NULL
- question — TEXT — NOT NULL
- answer — TEXT — NOT NULL
- ord — INT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
favorites
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- partner_id — BIGINT — Foreign key → users.id — NOT NULL
- created_at — DATETIME(6) — NOT NULL
notification_settings
- id — BIGINT — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- settings — JSON — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
notifications
- id — BIGINT — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- type — ENUM('matched','cancelled','reminder','invite','system') — NOT NULL
- payload — JSON
- is_read — TINYINT(1) — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- INDEX — `idx_notifications_user_created`
oauth_tokens
- id — BIGINT — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- provider — VARCHAR(50) — NOT NULL
- provider_user_id — VARCHAR(255)
- access_token — TEXT
- refresh_token — TEXT
- expires_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
password_resets
- id — BIGINT — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- token_hash — VARCHAR(255) — NOT NULL
- expires_at — DATETIME(6) — NOT NULL
- used_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
payments
- id — BIGINT — NOT NULL
- subscription_id — BIGINT — Foreign key → subscriptions.id
- provider — VARCHAR(50)
- provider_payment_id — VARCHAR(200)
- status — VARCHAR(50)
- amount_cents — BIGINT
- currency — VARCHAR(10) — NOT NULL
- metadata — JSON
- created_at — DATETIME(6) — NOT NULL
refresh_tokens
- id — BIGINT — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- token_hash — VARCHAR(255) — NOT NULL
- expires_at — DATETIME(6) — NOT NULL
- revoked_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
reports
- id — BIGINT — NOT NULL
- reporter_id — BIGINT — Foreign key → users.id — NOT NULL
- target_id — BIGINT — Foreign key → users.id — NOT NULL
- reason — ENUM('spam','inappropriate','other') — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- INDEX — `idx_reports_status`
session_goals
- id — BIGINT — NOT NULL
- session_id — BIGINT — Foreign key → sessions.id — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- goal_text — VARCHAR(100)
- result_text — VARCHAR(200)
- rating — SMALLINT
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
- INDEX — `idx_session_goals_user`
session_messages
- id — BIGINT — NOT NULL
- session_id — BIGINT — Foreign key → sessions.id — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- body — VARCHAR(200) — NOT NULL
- sent_at — DATETIME(6) — NOT NULL
- INDEX — `idx_session_messages_sent_at`
session_participants
- id — BIGINT — NOT NULL
- session_id — BIGINT — Foreign key → sessions.id — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- role — VARCHAR(20) — NOT NULL
- joined_at — DATETIME(6) — NOT NULL
- left_at — DATETIME(6)
- quiet_mode — TINYINT(1) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
- INDEX — `idx_session_participants_session`
session_videos
- id — BIGINT — NOT NULL
- session_id — BIGINT — Foreign key → sessions.id — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- youtube_url — TEXT — NOT NULL
- set_at — DATETIME(6) — NOT NULL
sessions
- id — BIGINT — NOT NULL
- host_id — BIGINT — Foreign key → users.id — NOT NULL
- partner_id — BIGINT — Foreign key → users.id
- starts_at — DATETIME(6) — NOT NULL
- duration_min — SMALLINT — NOT NULL
- focus_mode — ENUM('desk','moving','any') — NOT NULL
- status — ENUM('open','matched','active','done','cancelled') — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
- INDEX — `idx_sessions_starts_at`
subscriptions
- id — BIGINT — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- plan — ENUM('free','plus_monthly','plus_yearly') — NOT NULL
- starts_at — DATETIME(6) — NOT NULL
- expires_at — DATETIME(6)
- payment_key — VARCHAR(100)
- updated_at — DATETIME(6) — NOT NULL
- INDEX — `idx_subscriptions_expires_at`
users
- id — BIGINT — NOT NULL
- email — VARCHAR(255) — NOT NULL
- password_hash — VARCHAR(255)
- nickname — VARCHAR(50) — NOT NULL
- avatar_url — TEXT
- bio — VARCHAR(200)
- timezone — VARCHAR(50) — NOT NULL
- role — ENUM('user','admin') — NOT NULL
- status — ENUM('active','suspended','deleted') — NOT NULL
- deleted_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL