curio

Tables (25)

admin_accounts

  • id — uuid — Primary key — NOT NULL
  • email — varchar(255) — NOT NULL
  • password_hash — varchar(255) — NOT NULL
  • display_name — varchar(80) — NOT NULL
  • role — varchar(50) — NOT NULL
  • status — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

ai_answer_sources

  • id — uuid — Primary key — NOT NULL
  • ai_answer_id — uuid — Foreign key → ai_answers.id — NOT NULL
  • source_id — uuid — Foreign key → knowledge_sources.id — NOT NULL
  • snippet — text
  • retrieval_score — numeric(6,4)
  • rank_order — int — NOT NULL

ai_answers

  • id — uuid — Primary key — NOT NULL
  • exploration_id — uuid — Foreign key → explorations.id — NOT NULL
  • summary — text — NOT NULL
  • easy_explanation — text — NOT NULL
  • image_url — text
  • image_alt — text
  • model_name — varchar(100) — NOT NULL
  • prompt_version — varchar(50) — NOT NULL
  • safety_policy_version — varchar(50) — NOT NULL
  • safety_status — varchar(30) — NOT NULL
  • latency_ms — int
  • created_at — timestamptz — NOT NULL

categories

  • id — uuid — Primary key — NOT NULL
  • name — varchar(80) — NOT NULL
  • description — text
  • image_url — text
  • icon_key — varchar(100)
  • display_order — int — NOT NULL
  • status — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

child_answers

  • id — uuid — Primary key — NOT NULL
  • exploration_id — uuid — Foreign key → explorations.id — NOT NULL
  • answer_text — text — NOT NULL
  • safety_status — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

child_profiles

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • nickname — varchar(50) — NOT NULL
  • birth_year — int
  • grade — varchar(30)
  • profile_image_url — text
  • status — varchar(30) — NOT NULL
  • star_point — int — NOT NULL
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL

collection_discoveries

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • collection_item_id — uuid — Foreign key → collection_items.id — NOT NULL
  • source_exploration_id — uuid — Foreign key → explorations.id
  • source_graph_node_id — uuid — Foreign key → graph_nodes.id
  • discovery_reason — text
  • status — varchar(30) — NOT NULL
  • discovered_at — timestamptz — NOT NULL

collection_items

  • id — uuid — Primary key — NOT NULL
  • category_id — uuid — Foreign key → categories.id — NOT NULL
  • name — varchar(120) — NOT NULL
  • description — text
  • image_url — text
  • rarity — varchar(30) — NOT NULL
  • status — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

explorations

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • category_id — uuid — Foreign key → categories.id — NOT NULL
  • representative_question_id — uuid — Foreign key → representative_questions.id
  • parent_exploration_id — uuid — Foreign key → explorations.id
  • question_text — text — NOT NULL
  • source_type — varchar(50) — NOT NULL
  • status — varchar(30) — NOT NULL
  • summary — text
  • image_url — text
  • created_at — timestamptz — NOT NULL
  • expanded_at — timestamptz

followup_questions

  • id — uuid — Primary key — NOT NULL
  • ai_answer_id — uuid — Foreign key → ai_answers.id — NOT NULL
  • question_text — text — NOT NULL
  • reason — text
  • display_order — int — NOT NULL

friend_graph_views

  • id — uuid — Primary key — NOT NULL
  • friendship_id — uuid — Foreign key → friendships.id — NOT NULL
  • viewer_child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • target_child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • visible_category_count — int — NOT NULL
  • visible_concept_count — int — NOT NULL
  • redaction_policy_version — varchar(50) — NOT NULL
  • viewed_at — timestamptz — NOT NULL

friend_invites

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • code_hash — varchar(255) — NOT NULL
  • max_uses — int — NOT NULL
  • used_count — int — NOT NULL
  • expires_at — timestamptz — NOT NULL
  • status — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

friend_requests

  • id — uuid — Primary key — NOT NULL
  • invite_id — uuid — Foreign key → friend_invites.id — NOT NULL
  • requester_child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • target_child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • status — varchar(40) — NOT NULL
  • created_at — timestamptz — NOT NULL
  • resolved_at — timestamptz

friendships

  • id — uuid — Primary key — NOT NULL
  • child_a_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • child_b_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • status — varchar(30) — NOT NULL
  • blocked_by_child_id — uuid — Foreign key → child_profiles.id
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL

graph_edges

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • source_node_id — uuid — Foreign key → graph_nodes.id — NOT NULL
  • target_node_id — uuid — Foreign key → graph_nodes.id — NOT NULL
  • edge_type — varchar(50) — NOT NULL
  • confidence — numeric(6,4)
  • created_by — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

graph_insight_links

  • id — uuid — Primary key — NOT NULL
  • insight_id — uuid — Foreign key → graph_insights.id — NOT NULL
  • graph_node_id — uuid — Foreign key → graph_nodes.id — NOT NULL
  • link_role — varchar(50) — NOT NULL

graph_insights

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • insight_type — varchar(50) — NOT NULL
  • title — varchar(120) — NOT NULL
  • message — text — NOT NULL
  • metadata_json — jsonb — NOT NULL
  • confidence — numeric(6,4)
  • status — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

graph_nodes

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • exploration_id — uuid — Foreign key → explorations.id
  • node_type — varchar(30) — NOT NULL
  • label — varchar(160) — NOT NULL
  • normalized_key — varchar(200)
  • description — text
  • image_url — text
  • internal_only — boolean — NOT NULL
  • visibility — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL

knowledge_sources

  • id — uuid — Primary key — NOT NULL
  • title — varchar(255) — NOT NULL
  • provider — varchar(120) — NOT NULL
  • source_uri — text
  • status — varchar(30) — NOT NULL

lens_results

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • exploration_id — uuid — Foreign key → explorations.id
  • term — varchar(120) — NOT NULL
  • context_text — text
  • one_line_definition — text — NOT NULL
  • easy_explanation — text — NOT NULL
  • image_url — text
  • created_at — timestamptz — NOT NULL

parent_reports

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • parent_report_type — varchar(30) — NOT NULL
  • period_start — date — NOT NULL
  • period_end — date — NOT NULL
  • ai_comment — text
  • snapshot_json — jsonb — NOT NULL
  • generated_at — timestamptz — NOT NULL
  • version — int — NOT NULL

representative_questions

  • id — uuid — Primary key — NOT NULL
  • category_id — uuid — Foreign key → categories.id — NOT NULL
  • question_text — text — NOT NULL
  • keywords — jsonb
  • display_order — int — NOT NULL
  • status — varchar(30) — NOT NULL

reward_ledger

  • id — uuid — Primary key — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id — NOT NULL
  • reward_type — varchar(30) — NOT NULL
  • amount — int — NOT NULL
  • collection_item_id — uuid — Foreign key → collection_items.id
  • reason_type — varchar(50) — NOT NULL
  • reference_id — uuid
  • created_at — timestamptz — NOT NULL

user_reports

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — Foreign key → users.id — NOT NULL
  • child_id — uuid — Foreign key → child_profiles.id
  • user_report_type — varchar(50) — NOT NULL
  • target_type — varchar(50)
  • target_id — uuid
  • title — varchar(120) — NOT NULL
  • description — text
  • status — varchar(30) — NOT NULL
  • checked_by_admin_id — uuid — Foreign key → admin_accounts.id
  • checked_at — timestamptz
  • created_at — timestamptz — NOT NULL

users

  • id — uuid — Primary key — NOT NULL
  • email — varchar(255) — NOT NULL
  • password_hash — varchar(255) — NOT NULL
  • display_name — varchar(80) — NOT NULL
  • pin_hash — varchar(255)
  • status — varchar(30) — NOT NULL
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL