REBLOOM_4

Tables (25)

ai_insights

  • id — BIGINT — Primary key — NOT NULL
  • child_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • risk_event_id — BIGINT — Foreign key → risk_events.id
  • inference_request_id — BIGINT — Foreign key → inference_requests.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 — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • 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
  • hrv_enabled — BOOLEAN — NOT NULL
  • acc_enabled — BOOLEAN — NOT NULL
  • bvp_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 — Primary key — NOT NULL
  • 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)
  • acc_x — DECIMAL(10,4)
  • acc_y — DECIMAL(10,4)
  • acc_z — DECIMAL(10,4)
  • bvp — DECIMAL(10,4)
  • stress_score — DECIMAL(10,2)
  • sleep_minutes — INT
  • activity_steps — INT
  • raw_payload — TEXT
  • created_at — DATETIME — NOT NULL

child_counselor_relations

  • id — BIGINT — Primary key — NOT NULL
  • 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
  • created_at — DATETIME — NOT NULL

child_devices

  • id — BIGINT — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • 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
  • updated_at — DATETIME

child_risk_states

  • id — BIGINT — Primary key — NOT NULL
  • child_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • latest_risk_event_id — BIGINT — Foreign key → risk_events.id
  • current_risk_level — VARCHAR(20) — NOT NULL
  • current_risk_score — DECIMAL(5,2)
  • state_message — VARCHAR(500)
  • updated_at — DATETIME — NOT NULL

conversation_keywords

  • id — BIGINT — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • child_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • device_id — BIGINT — Foreign key → devices.id
  • started_at — DATETIME — NOT NULL
  • ended_at — DATETIME
  • session_summary — TEXT

counselor_todos

  • id — BIGINT — Primary key — NOT NULL
  • counselor_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • child_user_id — BIGINT — Foreign key → users.id
  • 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

dashboard_daily_summaries

  • id — BIGINT — Primary key — NOT NULL
  • child_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • summary_date — DATE — NOT NULL
  • risk_level — VARCHAR(20)
  • risk_score — DECIMAL(5,2)
  • sleep_minutes — INT
  • avg_heart_rate — DECIMAL(10,2)
  • avg_hrv — DECIMAL(10,2)
  • stress_score — DECIMAL(10,2)
  • activity_steps — INT
  • negative_keyword_count — INT
  • positive_keyword_count — INT
  • summary_message — VARCHAR(500)
  • updated_at — DATETIME — NOT NULL

devices

  • id — BIGINT — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • 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

inference_requests

  • id — BIGINT — Primary key — NOT NULL
  • child_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • session_id — BIGINT — Foreign key → conversation_sessions.id
  • request_type — VARCHAR(30) — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • prompt_text — TEXT
  • result_text — TEXT
  • model_name — VARCHAR(100)
  • requested_at — DATETIME — NOT NULL
  • completed_at — DATETIME

iot_status_records

  • id — BIGINT — Primary key — NOT NULL
  • device_id — BIGINT — Foreign key → devices.id — NOT NULL
  • recorded_at — DATETIME — NOT NULL
  • online_status — VARCHAR(20) — NOT NULL
  • battery_level — DECIMAL(5,2)
  • network_strength — DECIMAL(5,2)
  • raw_payload — TEXT
  • created_at — DATETIME — NOT NULL

observation_replies

  • id — BIGINT — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • 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 — Primary key — NOT NULL
  • child_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • risk_level — VARCHAR(20) — NOT NULL
  • risk_score — DECIMAL(5,2)
  • risk_type — VARCHAR(30) — NOT NULL
  • detected_at — DATETIME — NOT NULL
  • summary_message — VARCHAR(500) — NOT NULL
  • ai_comment — TEXT
  • status — VARCHAR(20) — NOT NULL

risk_notifications

  • id — BIGINT — Primary key — NOT NULL
  • risk_event_id — BIGINT — Foreign key → risk_events.id — NOT NULL
  • recipient_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • push_token_id — BIGINT — Foreign key → user_push_tokens.id
  • channel — VARCHAR(20) — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • body — TEXT — NOT NULL
  • sent_at — DATETIME
  • read_at — DATETIME
  • status — VARCHAR(20) — NOT NULL

user_push_tokens

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • device_id — BIGINT — Foreign key → devices.id
  • platform — VARCHAR(20) — NOT NULL
  • provider — VARCHAR(20) — NOT NULL
  • push_token — VARCHAR(500) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • last_used_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_roles

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • role — VARCHAR(30) — NOT NULL
  • created_at — DATETIME — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255)
  • nickname — VARCHAR(100)
  • profile_image_url — VARCHAR(500)
  • status — VARCHAR(20) — NOT NULL
  • onboarding_completed — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL