REBLOOM_test
Tables (20)
ai_insights
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- risk_event_id — BIGINT — Foreign key → risk_events.id
- insight_type — VARCHAR(20) — NOT NULL
- summary_text — TEXT — NOT NULL
- stress_factor — VARCHAR(255)
- recommended_focus — VARCHAR(255)
- generated_at — DATETIME — NOT NULL
auth_accounts
- id — BIGINT
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- provider — VARCHAR(30) — NOT NULL
- provider_user_id — VARCHAR(255) — NOT NULL
- provider_email — VARCHAR(255)
- created_at — DATETIME — NOT NULL
biometric_permissions
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- device_id — BIGINT — Foreign key → devices.id — NOT NULL
- heart_rate_enabled — BOOLEAN — NOT NULL
- sleep_enabled — BOOLEAN — NOT NULL
- stress_enabled — BOOLEAN — NOT NULL
- activity_enabled — BOOLEAN — NOT NULL
- granted_at — DATETIME — NOT NULL
- revoked_at — DATETIME
biometric_records
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- device_id — BIGINT — Foreign key → devices.id — NOT NULL
- recorded_at — DATETIME — NOT NULL
- heart_rate — INT
- hrv — DECIMAL(10,2)
- stress_score — DECIMAL(10,2)
- sleep_minutes — INT
- activity_steps — INT
- raw_payload — TEXT
- created_at — DATETIME — NOT NULL
child_counselor_relations
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- counselor_user_id — BIGINT — Foreign key → users.id — NOT NULL
- status — VARCHAR(20) — NOT NULL
- started_at — DATETIME
- ended_at — DATETIME
child_devices
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- device_id — BIGINT — Foreign key → devices.id — NOT NULL
- paired_at — DATETIME — NOT NULL
- is_active — BOOLEAN — NOT NULL
child_parent_relations
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- parent_user_id — BIGINT — Foreign key → users.id — NOT NULL
- relationship_type — VARCHAR(30) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- is_primary — BOOLEAN — NOT NULL
- created_at — DATETIME — NOT NULL
conversation_keywords
- id — BIGINT
- session_id — BIGINT — Foreign key → conversation_sessions.id — NOT NULL
- message_id — BIGINT — Foreign key → conversation_messages.id
- keyword — VARCHAR(100) — NOT NULL
- sentiment_type — VARCHAR(20) — NOT NULL
- score — DECIMAL(10,2)
- extracted_at — DATETIME — NOT NULL
conversation_messages
- id — BIGINT
- session_id — BIGINT — Foreign key → conversation_sessions.id — NOT NULL
- speaker_type — VARCHAR(20) — NOT NULL
- content — TEXT — NOT NULL
- sent_at — DATETIME — NOT NULL
conversation_sessions
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- device_id — BIGINT — Foreign key → devices.id — NOT NULL
- started_at — DATETIME — NOT NULL
- ended_at — DATETIME
- session_summary — TEXT
counselor_todos
- id — BIGINT
- counselor_user_id — BIGINT — Foreign key → users.id — NOT NULL
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- title — VARCHAR(200) — NOT NULL
- description — TEXT
- start_at — DATETIME — NOT NULL
- end_at — DATETIME — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
devices
- id — BIGINT
- device_type — VARCHAR(30) — NOT NULL
- device_name — VARCHAR(100) — NOT NULL
- serial_number — VARCHAR(100)
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
diaries
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- title — VARCHAR(200)
- content — TEXT — NOT NULL
- emotion_tag — VARCHAR(50)
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME
diary_share_settings
- id — BIGINT
- diary_id — BIGINT — Foreign key → diaries.id — NOT NULL
- share_with_counselor — BOOLEAN — NOT NULL
- share_biometric_data — BOOLEAN — NOT NULL
- share_conversation_metrics — BOOLEAN — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
observation_replies
- id — BIGINT
- observation_log_id — BIGINT — Foreign key → parent_observation_logs.id — NOT NULL
- counselor_user_id — BIGINT — Foreign key → users.id — NOT NULL
- content — TEXT — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME
parent_observation_logs
- id — BIGINT
- parent_user_id — BIGINT — Foreign key → users.id — NOT NULL
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- content — TEXT — NOT NULL
- category_tag — VARCHAR(50)
- observed_at — DATETIME — NOT NULL
- created_at — DATETIME — NOT NULL
risk_events
- id — BIGINT
- child_user_id — BIGINT — Foreign key → users.id — NOT NULL
- risk_level — VARCHAR(20) — NOT NULL
- risk_type — VARCHAR(30) — NOT NULL
- detected_at — DATETIME — NOT NULL
- summary_message — VARCHAR(500) — NOT NULL
- ai_comment — TEXT — EXT NUL
- status — VARCHAR(20) — NOT NULL
risk_notifications
- id — BIGINT
- risk_event_id — BIGINT — Foreign key → risk_events.id — NOT NULL
- recipient_user_id — BIGINT — Foreign key → users.id — NOT NULL
- channel — VARCHAR(20) — NOT NULL
- title — VARCHAR(200) — NOT NULL
- body — TEXT — NOT NULL
- sent_at — DATETIME — NOT NULL
- read_at — DATETIME
- status — VARCHAR(20) — NOT NULL
user_roles
- id — BIGINT
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- role — VARCHAR(30) — NOT NULL
- created_at — DATETIME — NOT NULL
users
- id — BIGINT
- email — VARCHAR(255) — NOT NULL
- password_hash — VARCHAR(255)
- nickname — VARCHAR(100)
- profile_image_url — VARCHAR(500)
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL