AIBook
Tables (18)
ai_book_bundle_modules
- id — VARCHAR(36) — Primary key — NOT NULL
- bundle_id — VARCHAR(36) — Foreign key → ai_book_bundles.id — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- sort_order — INT — NOT NULL
- created_at — DATETIME — NOT NULL
ai_book_bundles
- id — VARCHAR(36) — Primary key — NOT NULL
- slug — VARCHAR(100) — NOT NULL
- title — VARCHAR(200) — NOT NULL
- description — TEXT
- status — VARCHAR(30) — NOT NULL
- sort_order — INT — NOT NULL
- published_at — DATETIME
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_chapters
- id — VARCHAR(36) — Primary key — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- title — VARCHAR(300) — NOT NULL
- summary — TEXT
- sort_order — INT — NOT NULL
- status — VARCHAR(30) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_content_blocks
- id — VARCHAR(36) — Primary key — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- chapter_id — VARCHAR(36) — Foreign key → ai_book_chapters.id — NOT NULL
- subunit_id — VARCHAR(36) — Foreign key → ai_book_subunits.id — NOT NULL
- block_type — VARCHAR(40) — NOT NULL
- sort_order — INT — NOT NULL
- content_text — TEXT
- latex — TEXT
- asset_key — TEXT
- payload — TEXT
- plain_text — TEXT
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_entitlements
- id — VARCHAR(36) — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- source_type — VARCHAR(40) — NOT NULL
- source_bundle_id — VARCHAR(36) — Foreign key → ai_book_bundles.id
- source_order_id — VARCHAR(100)
- status — VARCHAR(30) — NOT NULL
- granted_at — DATETIME — NOT NULL
- expires_at — DATETIME
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_highlights
- id — VARCHAR(36) — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- chapter_id — VARCHAR(36) — Foreign key → ai_book_chapters.id — NOT NULL
- subunit_id — VARCHAR(36) — Foreign key → ai_book_subunits.id — NOT NULL
- block_id — VARCHAR(36) — Foreign key → ai_book_content_blocks.id — NOT NULL
- block_type — VARCHAR(40) — NOT NULL
- anchor_start — INT — NOT NULL
- anchor_end — INT — NOT NULL
- anchor_text — TEXT — NOT NULL
- color — VARCHAR(30) — NOT NULL
- memo_content — VARCHAR(700)
- memo_updated_at — DATETIME
- status — VARCHAR(30) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME
ai_book_modules
- id — VARCHAR(36) — Primary key — NOT NULL
- slug — VARCHAR(100) — NOT NULL
- title — VARCHAR(200) — NOT NULL
- description — TEXT
- status — VARCHAR(30) — NOT NULL
- sort_order — INT — NOT NULL
- published_at — DATETIME
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_qna_messages
- id — VARCHAR(36) — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- chapter_id — VARCHAR(36) — Foreign key → ai_book_chapters.id — NOT NULL
- subunit_id — VARCHAR(36) — Foreign key → ai_book_subunits.id
- question_text — TEXT — NOT NULL
- answer_text — TEXT
- context_scope — VARCHAR(40) — NOT NULL
- status — VARCHAR(30) — NOT NULL
- model_name — VARCHAR(100)
- prompt_tokens — INT
- completion_tokens — INT
- error_message — TEXT
- created_at — DATETIME — NOT NULL
- answered_at — DATETIME
ai_book_qna_token_accounts
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- balance — INT — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_qna_token_ledger
- id — VARCHAR(36) — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id
- qna_message_id — VARCHAR(36) — Foreign key → ai_book_qna_messages.id
- change_amount — INT — NOT NULL
- balance_after — INT — NOT NULL
- reason — VARCHAR(40) — NOT NULL
- source_id — VARCHAR(100)
- created_at — DATETIME — NOT NULL
ai_book_quiz_attempts
- id — VARCHAR(36) — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- chapter_id — VARCHAR(36) — Foreign key → ai_book_chapters.id — NOT NULL
- quiz_id — VARCHAR(36) — Foreign key → ai_book_quizzes.id — NOT NULL
- selected_option_id — VARCHAR(36) — Foreign key → ai_book_quiz_options.id — NOT NULL
- is_correct — TINYINT — NOT NULL
- submitted_at — DATETIME — NOT NULL
ai_book_quiz_options
- id — VARCHAR(36) — Primary key — NOT NULL
- quiz_id — VARCHAR(36) — Foreign key → ai_book_quizzes.id — NOT NULL
- option_text — TEXT — NOT NULL
- is_correct — TINYINT — NOT NULL
- sort_order — INT — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_quizzes
- id — VARCHAR(36) — Primary key — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- chapter_id — VARCHAR(36) — Foreign key → ai_book_chapters.id — NOT NULL
- quiz_type — VARCHAR(30) — NOT NULL
- question — TEXT — NOT NULL
- explanation — TEXT
- sample_answer — TEXT
- sort_order — INT — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_subunit_reads
- id — VARCHAR(36) — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- chapter_id — VARCHAR(36) — Foreign key → ai_book_chapters.id — NOT NULL
- subunit_id — VARCHAR(36) — Foreign key → ai_book_subunits.id — NOT NULL
- read_at — DATETIME — NOT NULL
ai_book_subunits
- id — VARCHAR(36) — Primary key — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- chapter_id — VARCHAR(36) — Foreign key → ai_book_chapters.id — NOT NULL
- title — VARCHAR(300) — NOT NULL
- sort_order — INT — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_terms
- id — VARCHAR(36) — Primary key — NOT NULL
- module_id — VARCHAR(36) — Foreign key → ai_book_modules.id — NOT NULL
- term_key — VARCHAR(100) — NOT NULL
- term_text — VARCHAR(200) — NOT NULL
- description — TEXT — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
ai_book_viewer_settings
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- font_size — VARCHAR(20) — NOT NULL
- theme_mode — VARCHAR(20) — NOT NULL
- updated_at — DATETIME — NOT NULL
users
- id — BIGINT — Primary key — NOT NULL