-- MySQL dump 10.13  Distrib 8.0.43, for Linux (aarch64)
--
-- Host: localhost    Database: kaopeilian
-- ------------------------------------------------------
-- Server version	8.0.43

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `course_exam_settings`
--

DROP TABLE IF EXISTS `course_exam_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `course_exam_settings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `course_id` int NOT NULL COMMENT 'è¯¾ç¨‹ID',
  `single_choice_count` int NOT NULL DEFAULT '10' COMMENT 'å•é€‰é¢˜æ•°é‡',
  `multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT 'å¤šé€‰é¢˜æ•°é‡',
  `true_false_count` int NOT NULL DEFAULT '5' COMMENT 'åˆ¤æ–­é¢˜æ•°é‡',
  `fill_blank_count` int NOT NULL DEFAULT '0' COMMENT 'å¡«ç©ºé¢˜æ•°é‡',
  `duration_minutes` int NOT NULL DEFAULT '60' COMMENT 'è€ƒè¯•æ—¶é•¿(åˆ†é’Ÿ)',
  `difficulty_level` int NOT NULL DEFAULT '3' COMMENT 'éš¾åº¦ç³»æ•°(1-5)',
  `passing_score` int NOT NULL DEFAULT '60' COMMENT 'åŠæ ¼åˆ†æ•°',
  `is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'æ˜¯å¦å¯ç”¨',
  `show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'æ˜¯å¦ç«‹å³æ˜¾ç¤ºç­”æ¡ˆ',
  `allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'æ˜¯å¦å…è®¸é‡è€ƒ',
  `max_retake_times` int DEFAULT NULL COMMENT 'æœ€å¤§é‡è€ƒæ¬¡æ•°',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_by` int DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` int DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  `deleted_at` datetime DEFAULT NULL,
  `deleted_by` int DEFAULT NULL COMMENT 'åˆ é™¤äººID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `course_id` (`course_id`),
  KEY `ix_course_exam_settings_id` (`id`),
  CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='è¯¾ç¨‹è€ƒè¯•è®¾ç½®è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `course_exam_settings`
--

LOCK TABLES `course_exam_settings` WRITE;
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `course_materials`
--

DROP TABLE IF EXISTS `course_materials`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `course_materials` (
  `id` int NOT NULL AUTO_INCREMENT,
  `course_id` int NOT NULL COMMENT 'è¯¾ç¨‹ID',
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'èµ„æ–™åç§°',
  `description` text COLLATE utf8mb4_unicode_ci COMMENT 'èµ„æ–™æè¿°',
  `file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ–‡ä»¶URL',
  `file_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ–‡ä»¶ç±»åž‹',
  `file_size` int NOT NULL COMMENT 'æ–‡ä»¶å¤§å°(å­—èŠ‚)',
  `sort_order` int DEFAULT '0' COMMENT 'æŽ’åºé¡ºåº',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_course_id` (`course_id`),
  KEY `idx_is_deleted` (`is_deleted`),
  CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='è¯¾ç¨‹èµ„æ–™è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `course_materials`
--

LOCK TABLES `course_materials` WRITE;
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
INSERT INTO `course_materials` VALUES (1,1,'PythonåŸºç¡€æ•™ç¨‹.pdf','Pythonç¼–ç¨‹åŸºç¡€æ•™ç¨‹æ–‡æ¡£','/uploads/python-basics.pdf','pdf',2048000,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,1,'è¯¾ç¨‹è§†é¢‘1','ç¬¬ä¸€ç« èŠ‚è§†é¢‘æ•™ç¨‹','/uploads/video1.mp4','mp4',104857600,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `courses`
--

DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `courses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'è¯¾ç¨‹åç§°',
  `description` text COLLATE utf8mb4_unicode_ci COMMENT 'è¯¾ç¨‹æè¿°',
  `category` enum('technology','management','business','general') COLLATE utf8mb4_unicode_ci DEFAULT 'general' COMMENT 'è¯¾ç¨‹åˆ†ç±»',
  `status` enum('draft','published','archived') COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT 'è¯¾ç¨‹çŠ¶æ€',
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å°é¢å›¾ç‰‡URL',
  `duration_hours` float DEFAULT NULL COMMENT 'è¯¾ç¨‹æ—¶é•¿(å°æ—¶)',
  `difficulty_level` int DEFAULT NULL COMMENT 'éš¾åº¦ç­‰çº§(1-5)',
  `tags` json DEFAULT NULL COMMENT 'æ ‡ç­¾åˆ—è¡¨',
  `published_at` datetime DEFAULT NULL COMMENT 'å‘å¸ƒæ—¶é—´',
  `publisher_id` int DEFAULT NULL COMMENT 'å‘å¸ƒäººID',
  `sort_order` int DEFAULT '0' COMMENT 'æŽ’åºé¡ºåº',
  `is_featured` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦æŽ¨è',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  `created_by` int DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` int DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_category` (`category`),
  KEY `idx_is_featured` (`is_featured`),
  KEY `idx_is_deleted` (`is_deleted`),
  KEY `idx_sort_order` (`sort_order`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='è¯¾ç¨‹è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `courses`
--

LOCK TABLES `courses` WRITE;
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
INSERT INTO `courses` VALUES (1,'çš®è‚¤ç”Ÿç†å­¦åŸºç¡€','å­¦ä¹ çš®è‚¤ç»“æž„ã€åŠŸèƒ½å’Œå¸¸è§é—®é¢˜ï¼Œä¸ºä¸“ä¸šæŠ¤ç†æ‰“ä¸‹åŸºç¡€','technology','published',NULL,16,2,'[\"çš®è‚¤å­¦\", \"åŸºç¡€ç†è®º\", \"å¿…ä¿®è¯¾\"]','2025-09-22 17:18:23',NULL,100,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'åŒ»ç¾Žäº§å“çŸ¥è¯†ä¸Žåº”ç”¨','å…¨é¢äº†è§£å„ç±»åŒ»ç¾Žäº§å“çš„æˆåˆ†ã€åŠŸæ•ˆå’Œé€‚ç”¨äººç¾¤','technology','published',NULL,20,3,'[\"äº§å“çŸ¥è¯†\", \"åŒ»ç¾Ž\", \"ä¸“ä¸šæŠ€èƒ½\"]','2025-09-22 17:18:23',NULL,110,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,'ç¾Žå®¹ä»ªå™¨æ“ä½œä¸Žç»´æŠ¤','æŽŒæ¡å„ç±»ç¾Žå®¹ä»ªå™¨çš„æ“ä½œæ–¹æ³•ã€æ³¨æ„äº‹é¡¹å’Œæ—¥å¸¸ç»´æŠ¤','technology','published',NULL,24,3,'[\"ä»ªå™¨æ“ä½œ\", \"å®žæ“æŠ€èƒ½\", \"è®¾å¤‡ç»´æŠ¤\"]','2025-09-22 17:18:23',NULL,120,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,'åŒ»ç¾Žé¡¹ç›®ä»‹ç»ä¸Žå’¨è¯¢','è¯¦ç»†äº†è§£å„ç±»åŒ»ç¾Žé¡¹ç›®çš„åŽŸç†ã€æ•ˆæžœå’Œé€‚åº”ç—‡','technology','published',NULL,30,4,'[\"åŒ»ç¾Žé¡¹ç›®\", \"ä¸“ä¸šå’¨è¯¢\", \"é£Žé™©å‘ŠçŸ¥\"]','2025-09-22 17:18:23',NULL,170,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(5,'è½»åŒ»ç¾Žé”€å”®æŠ€å·§','å­¦ä¹ ä¸“ä¸šçš„é”€å”®è¯æœ¯ã€å®¢æˆ·éœ€æ±‚åˆ†æžå’Œæˆäº¤æŠ€å·§','business','published',NULL,16,2,'[\"é”€å”®æŠ€å·§\", \"å®¢æˆ·æ²Ÿé€š\", \"ä¸šç»©æå‡\"]','2025-09-22 17:18:23',NULL,130,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(6,'å®¢æˆ·æœåŠ¡ä¸ŽæŠ•è¯‰å¤„ç†','æå‡æœåŠ¡æ„è¯†ï¼ŒæŽŒæ¡å®¢æˆ·æŠ•è¯‰å¤„ç†çš„æ–¹æ³•å’ŒæŠ€å·§','business','published',NULL,12,2,'[\"å®¢æˆ·æœåŠ¡\", \"å±æœºå¤„ç†\", \"æ²Ÿé€šæŠ€å·§\"]','2025-09-22 17:18:23',NULL,140,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(7,'ç¤¾åª’è¥é”€ä¸Žç§åŸŸè¿è¥','å­¦ä¹ å¦‚ä½•é€šè¿‡ç¤¾äº¤åª’ä½“è¿›è¡Œå“ç‰ŒæŽ¨å¹¿å’Œå®¢æˆ·ç»´æŠ¤','business','published',NULL,16,2,'[\"ç¤¾åª’è¥é”€\", \"ç§åŸŸæµé‡\", \"å®¢æˆ·ç»´æŠ¤\"]','2025-09-22 17:18:23',NULL,180,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(8,'é—¨åº—è¿è¥ç®¡ç†','å­¦ä¹ é—¨åº—æ—¥å¸¸ç®¡ç†ã€å›¢é˜Ÿå»ºè®¾å’Œä¸šç»©ç®¡ç†','management','published',NULL,20,3,'[\"é—¨åº—ç®¡ç†\", \"å›¢é˜Ÿç®¡ç†\", \"è¿è¥ç­–ç•¥\"]','2025-09-22 17:18:23',NULL,160,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(9,'å«ç”Ÿæ¶ˆæ¯’ä¸Žæ„ŸæŸ“æŽ§åˆ¶','å­¦ä¹ åŒ»ç¾Žæœºæž„çš„å«ç”Ÿæ ‡å‡†å’Œæ¶ˆæ¯’æµç¨‹ï¼Œç¡®ä¿æœåŠ¡å®‰å…¨','general','published',NULL,8,1,'[\"å«ç”Ÿå®‰å…¨\", \"æ¶ˆæ¯’è§„èŒƒ\", \"åˆè§„ç®¡ç†\"]','2025-09-22 17:18:23',NULL,150,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(10,'Pythonç¼–ç¨‹åŸºç¡€','Pythonè¯­è¨€å…¥é—¨è¯¾ç¨‹ï¼Œé€‚åˆé›¶åŸºç¡€å­¦å‘˜','technology','published',NULL,40,2,'[\"Python\", \"ç¼–ç¨‹åŸºç¡€\", \"å…¥é—¨\"]','2025-09-22 17:18:23',NULL,200,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(11,'æ•°æ®åˆ†æžåŸºç¡€','å­¦ä¹ æ•°æ®åˆ†æžæ–¹æ³•å’Œå·¥å…·ï¼Œæå‡æ•°æ®é©±åŠ¨å†³ç­–èƒ½åŠ›','technology','published',NULL,32,3,'[\"æ•°æ®åˆ†æž\", \"Excel\", \"å¯è§†åŒ–\"]','2025-09-22 17:18:23',NULL,210,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `exam_results`
--

DROP TABLE IF EXISTS `exam_results`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `exam_results` (
  `id` int NOT NULL AUTO_INCREMENT,
  `exam_id` int NOT NULL COMMENT 'è€ƒè¯•ID',
  `question_id` int NOT NULL COMMENT 'é¢˜ç›®ID',
  `user_answer` text COLLATE utf8mb4_unicode_ci COMMENT 'ç”¨æˆ·ç­”æ¡ˆ',
  `is_correct` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦æ­£ç¡®',
  `score` float DEFAULT '0' COMMENT 'å¾—åˆ†',
  `answer_time` int DEFAULT NULL COMMENT 'ç­”é¢˜æ—¶é•¿ï¼ˆç§’ï¼‰',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_exam_id` (`exam_id`),
  KEY `idx_question_id` (`question_id`),
  CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='è€ƒè¯•ç»“æžœè¯¦æƒ…è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `exam_results`
--

LOCK TABLES `exam_results` WRITE;
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `exams`
--

DROP TABLE IF EXISTS `exams`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `exams` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL COMMENT 'ç”¨æˆ·ID',
  `course_id` int NOT NULL COMMENT 'è¯¾ç¨‹ID',
  `exam_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'è€ƒè¯•åç§°',
  `question_count` int DEFAULT '10' COMMENT 'é¢˜ç›®æ•°é‡',
  `total_score` float DEFAULT '100' COMMENT 'æ€»åˆ†',
  `pass_score` float DEFAULT '60' COMMENT 'åŠæ ¼åˆ†',
  `start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'å¼€å§‹æ—¶é—´',
  `end_time` datetime DEFAULT NULL COMMENT 'ç»“æŸæ—¶é—´',
  `duration_minutes` int DEFAULT '60' COMMENT 'è€ƒè¯•æ—¶é•¿ï¼ˆåˆ†é’Ÿï¼‰',
  `score` float DEFAULT NULL COMMENT 'å¾—åˆ†',
  `is_passed` tinyint(1) DEFAULT NULL COMMENT 'æ˜¯å¦é€šè¿‡',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'started' COMMENT 'çŠ¶æ€: started, submitted, timeout',
  `questions` json DEFAULT NULL COMMENT 'é¢˜ç›®æ•°æ®ï¼ˆJSONæ ¼å¼ï¼‰',
  `answers` json DEFAULT NULL COMMENT 'ç­”æ¡ˆæ•°æ®ï¼ˆJSONæ ¼å¼ï¼‰',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_course_id` (`course_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='è€ƒè¯•è®°å½•è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `exams`
--

LOCK TABLES `exams` WRITE;
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `growth_paths`
--

DROP TABLE IF EXISTS `growth_paths`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `growth_paths` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'è·¯å¾„åç§°',
  `description` text COLLATE utf8mb4_unicode_ci COMMENT 'è·¯å¾„æè¿°',
  `target_role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'ç›®æ ‡è§’è‰²',
  `courses` json DEFAULT NULL COMMENT 'è¯¾ç¨‹åˆ—è¡¨[{course_id, order, is_required}]',
  `estimated_duration_days` int DEFAULT NULL COMMENT 'é¢„è®¡å®Œæˆå¤©æ•°',
  `is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦å¯ç”¨',
  `sort_order` int DEFAULT '0' COMMENT 'æŽ’åºé¡ºåº',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_is_active` (`is_active`),
  KEY `idx_is_deleted` (`is_deleted`),
  KEY `idx_sort_order` (`sort_order`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='æˆé•¿è·¯å¾„è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `growth_paths`
--

LOCK TABLES `growth_paths` WRITE;
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
INSERT INTO `growth_paths` VALUES (1,'Pythonå·¥ç¨‹å¸ˆæˆé•¿è·¯å¾„','ä»Žå…¥é—¨åˆ°ç²¾é€šçš„Pythonå­¦ä¹ è·¯å¾„','Pythonå¼€å‘å·¥ç¨‹å¸ˆ','[{\"order\": 1, \"course_id\": 1, \"is_required\": true}, {\"order\": 2, \"course_id\": 4, \"is_required\": true}]',90,1,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'æŠ€æœ¯ç®¡ç†è€…è·¯å¾„','æŠ€æœ¯äººå‘˜è½¬åž‹ç®¡ç†å²—ä½','æŠ€æœ¯ç»ç†','[{\"order\": 1, \"course_id\": 2, \"is_required\": true}, {\"order\": 2, \"course_id\": 3, \"is_required\": false}]',60,1,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `knowledge_points`
--

DROP TABLE IF EXISTS `knowledge_points`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `knowledge_points` (
  `id` int NOT NULL AUTO_INCREMENT,
  `course_id` int NOT NULL COMMENT 'è¯¾ç¨‹ID',
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'çŸ¥è¯†ç‚¹åç§°',
  `description` text COLLATE utf8mb4_unicode_ci COMMENT 'çŸ¥è¯†ç‚¹æè¿°',
  `parent_id` int DEFAULT NULL COMMENT 'çˆ¶çŸ¥è¯†ç‚¹ID',
  `level` int DEFAULT '1' COMMENT 'å±‚çº§æ·±åº¦',
  `path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'è·¯å¾„(å¦‚: 1.2.3)',
  `sort_order` int DEFAULT '0' COMMENT 'æŽ’åºé¡ºåº',
  `weight` float DEFAULT '1' COMMENT 'æƒé‡',
  `is_required` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦å¿…ä¿®',
  `estimated_hours` float DEFAULT NULL COMMENT 'é¢„è®¡å­¦ä¹ æ—¶é—´(å°æ—¶)',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  `created_by` int DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` int DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_course_id` (`course_id`),
  KEY `idx_parent_id` (`parent_id`),
  KEY `idx_is_deleted` (`is_deleted`),
  KEY `idx_sort_order` (`sort_order`),
  CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='çŸ¥è¯†ç‚¹è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `knowledge_points`
--

LOCK TABLES `knowledge_points` WRITE;
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
INSERT INTO `knowledge_points` VALUES (1,1,'PythonçŽ¯å¢ƒæ­å»º','å­¦ä¹ å¦‚ä½•å®‰è£…å’Œé…ç½®Pythonå¼€å‘çŽ¯å¢ƒ',NULL,1,NULL,0,1,1,2,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,1,'PythonåŸºç¡€è¯­æ³•','å­¦ä¹ Pythonçš„åŸºæœ¬è¯­æ³•è§„åˆ™',NULL,1,NULL,0,2,1,8,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,1,'å˜é‡å’Œæ•°æ®ç±»åž‹','äº†è§£Pythonä¸­çš„å˜é‡å’ŒåŸºæœ¬æ•°æ®ç±»åž‹',2,2,NULL,0,1.5,1,3,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,1,'æŽ§åˆ¶æµç¨‹','å­¦ä¹ æ¡ä»¶è¯­å¥å’Œå¾ªçŽ¯ç»“æž„',2,2,NULL,0,1.5,1,4,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `material_knowledge_points`
--

DROP TABLE IF EXISTS `material_knowledge_points`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `material_knowledge_points` (
  `id` int NOT NULL AUTO_INCREMENT,
  `material_id` int NOT NULL COMMENT 'èµ„æ–™ID',
  `knowledge_point_id` int NOT NULL COMMENT 'çŸ¥è¯†ç‚¹ID',
  `sort_order` int DEFAULT '0' COMMENT 'æŽ’åºé¡ºåº',
  `is_ai_generated` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦AIç”Ÿæˆ',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
  KEY `idx_material_id` (`material_id`),
  KEY `idx_knowledge_point_id` (`knowledge_point_id`),
  CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
  CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='èµ„æ–™çŸ¥è¯†ç‚¹å…³è”è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `material_knowledge_points`
--

LOCK TABLES `material_knowledge_points` WRITE;
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `position_courses`
--

DROP TABLE IF EXISTS `position_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `position_courses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `position_id` int NOT NULL COMMENT 'å²—ä½ID',
  `course_id` int NOT NULL COMMENT 'è¯¾ç¨‹ID',
  `course_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT 'è¯¾ç¨‹ç±»åž‹',
  `priority` int DEFAULT '0' COMMENT 'ä¼˜å…ˆçº§/æŽ’åº',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_by` int DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` int DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
  KEY `course_id` (`course_id`),
  KEY `ix_position_courses_id` (`id`),
  CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
  CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å²—ä½è¯¾ç¨‹å…³è”è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `position_courses`
--

LOCK TABLES `position_courses` WRITE;
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
INSERT INTO `position_courses` VALUES (1,2,8,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(2,2,5,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(3,2,6,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(4,2,9,'required',4,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(9,3,7,'optional',5,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(10,4,1,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(11,4,3,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(12,4,9,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL);
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `position_members`
--

DROP TABLE IF EXISTS `position_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `position_members` (
  `id` int NOT NULL AUTO_INCREMENT,
  `position_id` int NOT NULL COMMENT 'å²—ä½ID',
  `user_id` int NOT NULL COMMENT 'ç”¨æˆ·ID',
  `role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'æˆå‘˜è§’è‰²ï¼ˆé¢„ç•™å­—æ®µï¼‰',
  `joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'åŠ å…¥æ—¶é—´',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_by` int DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` int DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
  KEY `user_id` (`user_id`),
  KEY `ix_position_members_id` (`id`),
  CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
  CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å²—ä½æˆå‘˜å…³è”è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `position_members`
--

LOCK TABLES `position_members` WRITE;
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
INSERT INTO `position_members` VALUES (1,2,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(2,3,3,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL);
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `positions`
--

DROP TABLE IF EXISTS `positions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `positions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å²—ä½åç§°',
  `code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å²—ä½ç¼–ç ',
  `description` text COLLATE utf8mb4_unicode_ci COMMENT 'å²—ä½æè¿°',
  `parent_id` int DEFAULT NULL COMMENT 'ä¸Šçº§å²—ä½ID',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active' COMMENT 'çŠ¶æ€: active/inactive',
  `skills` json DEFAULT NULL COMMENT 'æ ¸å¿ƒæŠ€èƒ½',
  `level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å²—ä½ç­‰çº§: junior/intermediate/senior/expert',
  `sort_order` int DEFAULT '0' COMMENT 'æŽ’åº',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  `created_by` int DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` int DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`),
  KEY `parent_id` (`parent_id`),
  KEY `idx_positions_name` (`name`),
  CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å²—ä½è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `positions`
--

LOCK TABLES `positions` WRITE;
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
INSERT INTO `positions` VALUES (1,'åŒºåŸŸç»ç†','region_manager','è´Ÿè´£å¤šå®¶é—¨åº—çš„è¿è¥ç®¡ç†å’Œä¸šç»©è¾¾æˆ',NULL,'active','[\"å›¢é˜Ÿç®¡ç†\", \"ä¸šç»©åˆ†æž\", \"æˆ˜ç•¥è§„åˆ’\", \"å®¢æˆ·å…³ç³»\"]','expert',10,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'åº—é•¿','store_manager','è´Ÿè´£é—¨åº—æ—¥å¸¸è¿è¥ç®¡ç†ï¼Œå›¢é˜Ÿå»ºè®¾å’Œä¸šç»©è¾¾æˆ',1,'active','[\"é—¨åº—ç®¡ç†\", \"å›¢é˜Ÿå»ºè®¾\", \"é”€å”®ç®¡ç†\", \"å®¢æˆ·ç»´æŠ¤\"]','senior',20,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,'ç¾Žå®¹é¡¾é—®','beauty_consultant','ä¸ºå®¢æˆ·æä¾›ä¸“ä¸šçš„ç¾Žå®¹å’¨è¯¢å’Œæ–¹æ¡ˆè®¾è®¡',2,'active','[\"äº§å“çŸ¥è¯†\", \"é”€å”®æŠ€å·§\", \"æ–¹æ¡ˆè®¾è®¡\", \"å®¢æˆ·æ²Ÿé€š\"]','intermediate',30,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,'åŒ»ç¾Žå’¨è¯¢å¸ˆ','medical_beauty_consultant','æä¾›åŒ»ç–—ç¾Žå®¹é¡¹ç›®å’¨è¯¢å’Œæ–¹æ¡ˆåˆ¶å®š',2,'active','[\"åŒ»ç¾ŽçŸ¥è¯†\", \"é£Žé™©è¯„ä¼°\", \"æ–¹æ¡ˆè®¾è®¡\", \"åˆè§„æ„è¯†\"]','senior',35,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(5,'ç¾Žå®¹æŠ€å¸ˆ','beauty_therapist','ä¸ºå®¢æˆ·æä¾›ä¸“ä¸šçš„ç¾Žå®¹æŠ¤ç†æœåŠ¡',2,'active','[\"æŠ¤è‚¤æŠ€æœ¯\", \"ä»ªå™¨æ“ä½œ\", \"æ‰‹æ³•æŠ€å·§\", \"æœåŠ¡æ„è¯†\"]','intermediate',40,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(6,'æŠ¤å£«','nurse','ååŠ©åŒ»ç”Ÿè¿›è¡ŒåŒ»ç¾Žé¡¹ç›®æ“ä½œï¼Œè´Ÿè´£æœ¯åŽæŠ¤ç†',2,'active','[\"æŠ¤ç†æŠ€æœ¯\", \"æ— èŒæ“ä½œ\", \"åº”æ€¥å¤„ç†\", \"åŒ»ç–—çŸ¥è¯†\"]','intermediate',45,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(7,'å‰å°æŽ¥å¾…','receptionist','è´Ÿè´£å®¢æˆ·æŽ¥å¾…ã€é¢„çº¦ç®¡ç†å’Œå‰å°äº‹åŠ¡',2,'active','[\"æŽ¥å¾…ç¤¼ä»ª\", \"æ²Ÿé€šèƒ½åŠ›\", \"ä¿¡æ¯ç®¡ç†\", \"æœåŠ¡æ„è¯†\"]','junior',50,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(8,'å¸‚åœºä¸“å‘˜','marketing_specialist','è´Ÿè´£é—¨åº—è¥é”€æ´»åŠ¨ç­–åˆ’å’Œæ‰§è¡Œ',2,'active','[\"æ´»åŠ¨ç­–åˆ’\", \"ç¤¾åª’è¿è¥\", \"æ•°æ®åˆ†æž\", \"åˆ›æ„è®¾è®¡\"]','intermediate',60,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `questions`
--

DROP TABLE IF EXISTS `questions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `questions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `course_id` int NOT NULL COMMENT 'è¯¾ç¨‹ID',
  `question_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'é¢˜ç›®ç±»åž‹: single_choice, multiple_choice, true_false, fill_blank, essay',
  `title` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'é¢˜ç›®æ ‡é¢˜',
  `content` text COLLATE utf8mb4_unicode_ci COMMENT 'é¢˜ç›®å†…å®¹',
  `options` json DEFAULT NULL COMMENT 'é€‰é¡¹ï¼ˆJSONæ ¼å¼ï¼‰',
  `correct_answer` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ­£ç¡®ç­”æ¡ˆ',
  `explanation` text COLLATE utf8mb4_unicode_ci COMMENT 'ç­”æ¡ˆè§£é‡Š',
  `score` float DEFAULT '10' COMMENT 'åˆ†å€¼',
  `difficulty` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT 'éš¾åº¦ç­‰çº§: easy, medium, hard',
  `tags` json DEFAULT NULL COMMENT 'æ ‡ç­¾ï¼ˆJSONæ ¼å¼ï¼‰',
  `usage_count` int DEFAULT '0' COMMENT 'ä½¿ç”¨æ¬¡æ•°',
  `correct_count` int DEFAULT '0' COMMENT 'ç­”å¯¹æ¬¡æ•°',
  `is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦å¯ç”¨',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_course_id` (`course_id`),
  KEY `idx_question_type` (`question_type`),
  KEY `idx_difficulty` (`difficulty`),
  KEY `idx_is_active` (`is_active`),
  CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='é¢˜ç›®è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `questions`
--

LOCK TABLES `questions` WRITE;
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
INSERT INTO `questions` VALUES (1,1,'single_choice','Pythonä¸­å“ªä¸ªå…³é”®å­—ç”¨äºŽå®šä¹‰å‡½æ•°ï¼Ÿ',NULL,'{\"A\": \"def\", \"B\": \"function\", \"C\": \"fun\", \"D\": \"define\"}','A','Pythonä½¿ç”¨defå…³é”®å­—æ¥å®šä¹‰å‡½æ•°',10,'easy','[\"python\", \"åŸºç¡€\", \"å‡½æ•°\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,1,'single_choice','Pythonä¸­åˆ—è¡¨å’Œå…ƒç»„çš„ä¸»è¦åŒºåˆ«æ˜¯ä»€ä¹ˆï¼Ÿ',NULL,'{\"A\": \"åˆ—è¡¨æ˜¯æœ‰åºçš„ï¼Œå…ƒç»„æ˜¯æ— åºçš„\", \"B\": \"åˆ—è¡¨å¯å˜ï¼Œå…ƒç»„ä¸å¯å˜\", \"C\": \"åˆ—è¡¨åªèƒ½å­˜å‚¨æ•°å­—ï¼Œå…ƒç»„å¯ä»¥å­˜å‚¨ä»»ä½•ç±»åž‹\", \"D\": \"æ²¡æœ‰åŒºåˆ«\"}','B','åˆ—è¡¨æ˜¯å¯å˜çš„ï¼ˆmutableï¼‰ï¼Œè€Œå…ƒç»„æ˜¯ä¸å¯å˜çš„ï¼ˆimmutableï¼‰',10,'medium','[\"python\", \"æ•°æ®ç»“æž„\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,1,'true_false','Pythonæ˜¯ä¸€ç§ç¼–è¯‘åž‹è¯­è¨€',NULL,NULL,'false','Pythonæ˜¯ä¸€ç§è§£é‡Šåž‹è¯­è¨€ï¼Œä¸éœ€è¦ç¼–è¯‘æˆæœºå™¨ç ',10,'easy','[\"python\", \"åŸºç¡€\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,1,'fill_blank','Pythonä¸­ä½¿ç”¨____å…³é”®å­—å®šä¹‰ç±»',NULL,NULL,'class','ä½¿ç”¨classå…³é”®å­—å®šä¹‰ç±»',10,'easy','[\"python\", \"é¢å‘å¯¹è±¡\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `teams`
--

DROP TABLE IF EXISTS `teams`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `teams` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å›¢é˜Ÿåç§°',
  `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å›¢é˜Ÿä»£ç ',
  `description` text COLLATE utf8mb4_unicode_ci COMMENT 'å›¢é˜Ÿæè¿°',
  `team_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'department' COMMENT 'å›¢é˜Ÿç±»åž‹: department, project, study_group',
  `is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦æ¿€æ´»',
  `leader_id` int DEFAULT NULL COMMENT 'è´Ÿè´£äººID',
  `parent_id` int DEFAULT NULL COMMENT 'çˆ¶å›¢é˜ŸID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  UNIQUE KEY `code` (`code`),
  KEY `leader_id` (`leader_id`),
  KEY `parent_id` (`parent_id`),
  KEY `idx_team_type` (`team_type`),
  KEY `idx_is_active` (`is_active`),
  CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å›¢é˜Ÿè¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `teams`
--

LOCK TABLES `teams` WRITE;
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
INSERT INTO `teams` VALUES (1,'æŠ€æœ¯éƒ¨','TECH','è´Ÿè´£æŠ€æœ¯ç ”å‘å’Œç»´æŠ¤','department',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL),(2,'äº§å“éƒ¨','PROD','è´Ÿè´£äº§å“è®¾è®¡å’Œè§„åˆ’','department',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL),(3,'Pythonå­¦ä¹ å°ç»„','PY_GROUP','PythonæŠ€æœ¯å­¦ä¹ äº¤æµ','study_group',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL);
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `training_messages`
--

DROP TABLE IF EXISTS `training_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `training_messages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `session_id` int NOT NULL COMMENT 'ä¼šè¯ID',
  `role` enum('USER','ASSISTANT','SYSTEM') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ¶ˆæ¯è§’è‰²',
  `type` enum('TEXT','VOICE','SYSTEM') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ¶ˆæ¯ç±»åž‹',
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ¶ˆæ¯å†…å®¹',
  `voice_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'è¯­éŸ³æ–‡ä»¶URL',
  `voice_duration` float DEFAULT NULL COMMENT 'è¯­éŸ³æ—¶é•¿ï¼ˆç§’ï¼‰',
  `message_metadata` json DEFAULT NULL COMMENT 'æ¶ˆæ¯å…ƒæ•°æ®',
  `coze_message_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Cozeæ¶ˆæ¯ID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_session_id` (`session_id`),
  KEY `idx_role` (`role`),
  CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='é™ªç»ƒæ¶ˆæ¯è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `training_messages`
--

LOCK TABLES `training_messages` WRITE;
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `training_reports`
--

DROP TABLE IF EXISTS `training_reports`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `training_reports` (
  `id` int NOT NULL AUTO_INCREMENT,
  `session_id` int NOT NULL COMMENT 'ä¼šè¯ID',
  `user_id` int NOT NULL COMMENT 'ç”¨æˆ·ID',
  `overall_score` float NOT NULL COMMENT 'æ€»ä½“å¾—åˆ†',
  `dimension_scores` json NOT NULL COMMENT 'å„ç»´åº¦å¾—åˆ†',
  `strengths` json NOT NULL COMMENT 'ä¼˜åŠ¿ç‚¹',
  `weaknesses` json NOT NULL COMMENT 'å¾…æ”¹è¿›ç‚¹',
  `suggestions` json NOT NULL COMMENT 'æ”¹è¿›å»ºè®®',
  `detailed_analysis` text COLLATE utf8mb4_unicode_ci COMMENT 'è¯¦ç»†åˆ†æž',
  `transcript` text COLLATE utf8mb4_unicode_ci COMMENT 'å¯¹è¯æ–‡æœ¬è®°å½•',
  `statistics` json DEFAULT NULL COMMENT 'ç»Ÿè®¡æ•°æ®',
  `created_by` bigint DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` bigint DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `session_id` (`session_id`),
  KEY `idx_user_id` (`user_id`),
  CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='é™ªç»ƒæŠ¥å‘Šè¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `training_reports`
--

LOCK TABLES `training_reports` WRITE;
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `training_scenes`
--

DROP TABLE IF EXISTS `training_scenes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `training_scenes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'åœºæ™¯åç§°',
  `description` text COLLATE utf8mb4_unicode_ci COMMENT 'åœºæ™¯æè¿°',
  `category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'åœºæ™¯åˆ†ç±»',
  `ai_config` json DEFAULT NULL COMMENT 'AIé…ç½®ï¼ˆå¦‚Coze Bot IDç­‰ï¼‰',
  `prompt_template` text COLLATE utf8mb4_unicode_ci COMMENT 'æç¤ºè¯æ¨¡æ¿',
  `evaluation_criteria` json DEFAULT NULL COMMENT 'è¯„ä¼°æ ‡å‡†',
  `status` enum('DRAFT','ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci DEFAULT 'DRAFT' COMMENT 'åœºæ™¯çŠ¶æ€',
  `is_public` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦å…¬å¼€',
  `required_level` int DEFAULT NULL COMMENT 'æ‰€éœ€ç”¨æˆ·ç­‰çº§',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  `created_by` bigint DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` bigint DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_category` (`category`),
  KEY `idx_is_public` (`is_public`),
  KEY `idx_is_deleted` (`is_deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='é™ªç»ƒåœºæ™¯è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `training_scenes`
--

LOCK TABLES `training_scenes` WRITE;
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
INSERT INTO `training_scenes` VALUES (1,'Pythonç¼–ç¨‹åŠ©æ‰‹','å¸®åŠ©å­¦å‘˜è§£å†³Pythonç¼–ç¨‹é—®é¢˜','æŠ€æœ¯è¾…å¯¼','{\"bot_id\": \"python_assistant_bot\"}',NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'é¢è¯•æ¨¡æ‹Ÿ','æ¨¡æ‹ŸæŠ€æœ¯é¢è¯•åœºæ™¯','èŒä¸šå‘å±•','{\"bot_id\": \"interview_simulator_bot\"}',NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,'é¡¹ç›®è®¨è®º','é¡¹ç›®æ–¹æ¡ˆè®¨è®ºå’Œä¼˜åŒ–','é¡¹ç›®ç®¡ç†','{\"bot_id\": \"project_discussion_bot\"}',NULL,NULL,'DRAFT',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `training_sessions`
--

DROP TABLE IF EXISTS `training_sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `training_sessions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL COMMENT 'ç”¨æˆ·ID',
  `scene_id` int NOT NULL COMMENT 'åœºæ™¯ID',
  `coze_conversation_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Cozeä¼šè¯ID',
  `start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'å¼€å§‹æ—¶é—´',
  `end_time` datetime DEFAULT NULL COMMENT 'ç»“æŸæ—¶é—´',
  `duration_seconds` int DEFAULT NULL COMMENT 'æŒç»­æ—¶é•¿ï¼ˆç§’ï¼‰',
  `status` enum('CREATED','IN_PROGRESS','COMPLETED','CANCELLED','ERROR') COLLATE utf8mb4_unicode_ci DEFAULT 'CREATED' COMMENT 'ä¼šè¯çŠ¶æ€',
  `session_config` json DEFAULT NULL COMMENT 'ä¼šè¯é…ç½®',
  `total_score` float DEFAULT NULL COMMENT 'æ€»åˆ†',
  `evaluation_result` json DEFAULT NULL COMMENT 'è¯„ä¼°ç»“æžœè¯¦æƒ…',
  `created_by` bigint DEFAULT NULL COMMENT 'åˆ›å»ºäººID',
  `updated_by` bigint DEFAULT NULL COMMENT 'æ›´æ–°äººID',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_scene_id` (`scene_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='é™ªç»ƒä¼šè¯è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `training_sessions`
--

LOCK TABLES `training_sessions` WRITE;
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `user_teams`
--

DROP TABLE IF EXISTS `user_teams`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_teams` (
  `user_id` int NOT NULL,
  `team_id` int NOT NULL,
  `role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'member' COMMENT 'å›¢é˜Ÿè§’è‰²: member, leader',
  `joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'åŠ å…¥æ—¶é—´',
  PRIMARY KEY (`user_id`,`team_id`),
  KEY `team_id` (`team_id`),
  CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='ç”¨æˆ·å›¢é˜Ÿå…³è”è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user_teams`
--

LOCK TABLES `user_teams` WRITE;
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
INSERT INTO `user_teams` VALUES (2,1,'leader','2025-09-22 17:18:23'),(2,2,'leader','2025-09-22 17:18:23'),(3,1,'member','2025-09-22 17:18:23'),(3,3,'member','2025-09-22 17:18:23');
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'ç”¨æˆ·å',
  `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'é‚®ç®±',
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'æ‰‹æœºå·',
  `password_hash` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å¯†ç å“ˆå¸Œ',
  `full_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å§“å',
  `gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'æ€§åˆ«: male/female',
  `avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å¤´åƒURL',
  `bio` text COLLATE utf8mb4_unicode_ci COMMENT 'ä¸ªäººç®€ä»‹',
  `school` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å­¦æ ¡',
  `major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'ä¸“ä¸š',
  `role` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'trainee' COMMENT 'ç³»ç»Ÿè§’è‰²: admin, manager, trainee',
  `is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦æ¿€æ´»',
  `is_verified` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦éªŒè¯',
  `last_login_at` datetime DEFAULT NULL COMMENT 'æœ€åŽç™»å½•æ—¶é—´',
  `password_changed_at` datetime DEFAULT NULL COMMENT 'å¯†ç ä¿®æ”¹æ—¶é—´',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦åˆ é™¤',
  `deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `phone` (`phone`),
  KEY `idx_role` (`role`),
  KEY `idx_is_active` (`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='ç”¨æˆ·è¡¨';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'superadmin','superadmin@kaopeilian.com','13800000001','$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewKyNiQdP/sQj6C6','è¶…çº§ç®¡ç†å‘˜',NULL,NULL,NULL,NULL,NULL,'admin',1,1,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL),(2,'admin','admin@kaopeilian.com','13800000002','$2b$12$NEGFEN8951QMRQMauW53Qe2VLOajCRrTbpFZzyn9RjtlLDVvXawl.','ç³»ç»Ÿç®¡ç†å‘˜',NULL,NULL,NULL,NULL,NULL,'admin',1,1,'2025-09-22 17:30:31',NULL,'2025-09-22 17:18:23','2025-09-22 17:30:31',0,NULL),(3,'testuser','testuser@kaopeilian.com','13800000003','$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewKyNiQdP/sQj6C6','æµ‹è¯•å­¦å‘˜',NULL,NULL,NULL,NULL,NULL,'trainee',1,1,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary view structure for view `v_user_course_progress`
--

DROP TABLE IF EXISTS `v_user_course_progress`;
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
SET @saved_cs_client     = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT 
 1 AS `user_id`,
 1 AS `username`,
 1 AS `course_id`,
 1 AS `course_name`,
 1 AS `exam_count`,
 1 AS `avg_score`,
 1 AS `best_score`*/;
SET character_set_client = @saved_cs_client;

--
-- Dumping routines for database 'kaopeilian'
--

--
-- Final view structure for view `v_user_course_progress`
--

/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = latin1 */;
/*!50001 SET character_set_results     = latin1 */;
/*!50001 SET collation_connection      = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-09-22 17:34:56
