lastproject
Tables (21)
ACHIEVEMENTS
- achievement_id — BIGINT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- description — VARCHAR(1000) — NOT NULL
- icon_url — VARCHAR(2048) — NOT NULL
- condition — VARCHAR(255) — NOT NULL
AI_PROCESS_LOGS
- log_id — BIGINT — Primary key — NOT NULL
- process_type — VARCHAR(50) — NOT NULL
- status — VARCHAR(20)
- details — JSON
- created_at — TIMESTAMP
- document_id — BIGINT — Foreign key → USER_UPLOADED_DOCUMENTS.document_id — NOT NULL
AI_QUESTIONS
- ai_question_id — BIGINT — Primary key — NOT NULL
- document_id — BIGINT — Foreign key → USER_UPLOADED_DOCUMENTS.document_id — NOT NULL
- quiz_id — BIGINT — Foreign key → QUIZZES.quiz_id — NOT NULL
AI_SUMMARIES
- summary_id — BIGINT — Primary key — NOT NULL
- summary_text — TEXT — NOT NULL
- created_at — TIMESTAMP
- updated_at — TIMESTAMP
- document_id — BIGINT — Foreign key → USER_UPLOADED_DOCUMENTS.document_id — NOT NULL
AI_TOOL_LOGS
- log_id — BIGINT — Primary key — NOT NULL
- tool_name — VARCHAR(100) — NOT NULL
- tool_input — LONGTEXT
- tool_output — LONGTEXT
- execution_time_ms — BIGINT
- called_at — TIMESTAMP — NOT NULL
- message_id — BIGINT — Foreign key → MESSAGES.message_id — NOT NULL
- Key — Foreign key — NOT NULL
CHAT_ROOMS
- chat_room_id — BIGINT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- last_activity_at — TIMESTAMP — NOT NULL
- user_id — BIGINT — Foreign key → USERS.user_id — NOT NULL
- curriculum_id — BIGINT — Foreign key → MASTER_CURRICULUMS.curriculum_id — NOT NULL
- topic_id — BIGINT — Foreign key → CURRICULUM_TOPICS.topic_id — NOT NULL
CURRICULUM_CHAPTERS
- chapter_id — BIGINT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- chapter_order — INT — NOT NULL
- curriculum_id — BIGINT — Foreign key → MASTER_CURRICULUMS.curriculum_id — NOT NULL
CURRICULUM_TOPICS
- topic_id — BIGINT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- topic_order — INT — NOT NULL
- chapter_id — BIGINT — Foreign key → CURRICULUM_CHAPTERS.chapter_id — NOT NULL
GLOBAL_CHAT_SESSIONS
- session_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- last_activity_at — TIMESTAMP — NOT NULL
MASTER_CURRICULUMS
- curriculum_id — BIGINT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- description — LONGTEXT
- target_grade — VARCHAR(50)
- target_focus — VARCHAR(50)
- created_at — TIMESTAMP — NOT NULL
MESSAGES
- message_id — BIGINT — Primary key — NOT NULL
- author_type — ENUM('USER', 'AI') — NOT NULL
- content — LONGTEXT
- input_type — ENUM('TEXT','CANVAS_IMAGE','WEBCAM_VIDEO','SYSTEM') — NOT NULL
- page_context — LONGTEXT
- created_at — TIMESTAMP — NOT NULL
- chat_room_id — BIGINT — Foreign key → CHAT_ROOMS.chat_room_id — NOT NULL
- session_id — BIGINT — Foreign key → GLOBAL_CHAT_SESSIONS.session_id — NOT NULL
- user_id — BIGINT — Foreign key → USERS.user_id — NOT NULL
MESSAGE_ATTACHMENTS
- attachment_id — BIGINT — Primary key — NOT NULL
- file_type — VARCHAR(50) — NOT NULL
- file_url — VARCHAR(2048) — NOT NULL
- file_size_bytes — BIGINT
- metadata — JSON
- created_at — TIMESTAMP — NOT NULL
- message_id — BIGINT — Foreign key → MESSAGES.message_id — NOT NULL
- Key — Foreign key — NOT NULL
QUIZZES
- quiz_id — BIGINT — Primary key — NOT NULL
- quiz_type — VARCHAR(20) — NOT NULL
- question — LONGTEXT — NOT NULL
- options — LONGTEXT
- correct_answer — VARCHAR(1000) — NOT NULL
- difficulty — TINYINT — NOT NULL
- created_at — TIMESTAMP
- topic_id — BIGINT — Foreign key → CURRICULUM_TOPICS.topic_id — NOT NULL
RAG_DOCUMENTS
- document_id — BIGINT — Primary key — NOT NULL
- document_name — VARCHAR(255) — NOT NULL
- file_path — VARCHAR(2048) — NOT NULL
- file_type — VARCHAR(20) — NOT NULL
- description — VARCHAR(1000)
- version — INT — NOT NULL
- uploaded_at — TIMESTAMP — NOT NULL
- last_processed_at — TIMESTAMP
- topic_id — BIGINT — Foreign key → CURRICULUM_TOPICS.topic_id — NOT NULL
USERS
- user_id — BIGINT — Primary key — NOT NULL
- username — VARCHAR(50) — NOT NULL
- name — VARCHAR(50)
- password_hash — VARCHAR(255) — NOT NULL
- email — VARCHAR(255) — NOT NULL
- provider — VARCHAR(20) — NOT NULL
- provider_id — VARCHAR(100)
- email_verified — BOOLEAN
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
USER_ACHIEVEMENTS
- user_id — BIGINT — Foreign key → USERS.user_id — NOT NULL
- achievement_id — BIGINT — Foreign key → ACHIEVEMENTS.achievement_id — NOT NULL
- earned_at — TIMESTAMP — NOT NULL
USER_CATEGORIES
- category_id — BIGINT — Primary key — NOT NULL
- category_name — VARCHAR(100) — NOT NULL
USER_PROFILES
- user_id — BIGINT — Foreign key → USERS.user_id — NOT NULL
- details — JSON
- interests — VARCHAR(1000)
- learning_style — VARCHAR(50)
- updated_at — TIMESTAMP — NOT NULL
- category_id — BIGINT — Foreign key → USER_CATEGORIES.category_id — NOT NULL
USER_QUIZ_ATTEMPTS
- attempt_id — BIGINT — Primary key — NOT NULL
- user_answer — VARCHAR(1000) — NOT NULL
- is_correct — TINYINT — NOT NULL
- attempted_at — TIMESTAMP — NOT NULL
- user_id — BIGINT — Foreign key → USERS.user_id — NOT NULL
- quiz_id — BIGINT — Foreign key → QUIZZES.quiz_id — NOT NULL
USER_TOPIC_PROGRESS
- topic_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → USERS.user_id — NOT NULL
- display_order — INT — NOT NULL
- status — ENUM('NOT_STARTED', 'IN_PROGRESS', 'COMPLETED') — NOT NULL
- score — INT
- started_at — TIMESTAMP
- completed_at — TIMESTAMP
- last_accessed_at — TIMESTAMP
USER_UPLOADED_DOCUMENTS
- document_id — BIGINT — Primary key — NOT NULL
- document_name — VARCHAR(255) — NOT NULL
- file_path — VARCHAR(2048) — NOT NULL
- file_type — VARCHAR(20) — NOT NULL
- description — VARCHAR(1000)
- version — INT — NOT NULL
- uploaded_at — TIMESTAMP
- last_processed_at — TIMESTAMP
- user_id — BIGINT — Foreign key → USERS.user_id — NOT NULL