-- MySQL dump 10.13  Distrib 8.0.44, for Win64 (x86_64)
--
-- Host: localhost    Database: db_competition_management
-- ------------------------------------------------------
-- Server version	8.0.44

/*!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 `classes`
--
USE db_competition_management;

DROP TABLE IF EXISTS `classes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `classes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `grade_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` int NOT NULL DEFAULT '1',
  `capacity` int DEFAULT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `classes_tenant_id_code_key` (`tenant_id`,`code`),
  KEY `classes_grade_id_fkey` (`grade_id`),
  KEY `classes_creator_fkey` (`creator`),
  KEY `classes_modifier_fkey` (`modifier`),
  CONSTRAINT `classes_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `classes_grade_id_fkey` FOREIGN KEY (`grade_id`) REFERENCES `grades` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `classes_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `classes_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `classes`
--

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

--
-- Table structure for table `configs`
--

DROP TABLE IF EXISTS `configs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `configs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `configs_tenant_id_key_key` (`tenant_id`,`key`),
  KEY `configs_creator_fkey` (`creator`),
  KEY `configs_modifier_fkey` (`modifier`),
  CONSTRAINT `configs_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `configs_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `configs_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `configs`
--

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

--
-- Table structure for table `departments`
--

DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `departments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` int DEFAULT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sort` int NOT NULL DEFAULT '0',
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `departments_tenant_id_code_key` (`tenant_id`,`code`),
  KEY `departments_parent_id_fkey` (`parent_id`),
  KEY `departments_creator_fkey` (`creator`),
  KEY `departments_modifier_fkey` (`modifier`),
  CONSTRAINT `departments_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `departments_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `departments_parent_id_fkey` FOREIGN KEY (`parent_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `departments_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `departments`
--

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

--
-- Table structure for table `dict_items`
--

DROP TABLE IF EXISTS `dict_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dict_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dict_id` int NOT NULL,
  `label` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sort` int NOT NULL DEFAULT '0',
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `dict_items_dict_id_fkey` (`dict_id`),
  KEY `dict_items_creator_fkey` (`creator`),
  KEY `dict_items_modifier_fkey` (`modifier`),
  CONSTRAINT `dict_items_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `dict_items_dict_id_fkey` FOREIGN KEY (`dict_id`) REFERENCES `dicts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `dict_items_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `dict_items`
--

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

--
-- Table structure for table `dicts`
--

DROP TABLE IF EXISTS `dicts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dicts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `dicts_tenant_id_code_key` (`tenant_id`,`code`),
  KEY `dicts_creator_fkey` (`creator`),
  KEY `dicts_modifier_fkey` (`modifier`),
  CONSTRAINT `dicts_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `dicts_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `dicts_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `dicts`
--

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

--
-- Table structure for table `grades`
--

DROP TABLE IF EXISTS `grades`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `grades` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` int NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `grades_tenant_id_code_key` (`tenant_id`,`code`),
  UNIQUE KEY `grades_tenant_id_level_key` (`tenant_id`,`level`),
  KEY `grades_creator_fkey` (`creator`),
  KEY `grades_modifier_fkey` (`modifier`),
  CONSTRAINT `grades_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `grades_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `grades_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `grades`
--

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

--
-- Table structure for table `logs`
--

DROP TABLE IF EXISTS `logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `action` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`),
  KEY `logs_user_id_fkey` (`user_id`),
  CONSTRAINT `logs_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `logs`
--

LOCK TABLES `logs` WRITE;
/*!40000 ALTER TABLE `logs` DISABLE KEYS */;
INSERT INTO `logs` VALUES (1,1,'GET /api/menus/user-menus','{\"method\":\"GET\",\"url\":\"/api/menus/user-menus\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:07.750'),(2,1,'GET /api/contests?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:08.449'),(3,1,'GET /api/tenants?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/tenants?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:08.459'),(4,1,'GET /api/roles?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/roles?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:13.977'),(5,1,'GET /api/permissions?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/permissions?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:13.981'),(6,1,'GET /api/menus','{\"method\":\"GET\",\"url\":\"/api/menus\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:15.736'),(7,1,'GET /api/users?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/users?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:17.133'),(8,1,'GET /api/roles?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/roles?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:17.137'),(9,1,'GET /api/menus','{\"method\":\"GET\",\"url\":\"/api/menus\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:21.452'),(10,1,'GET /api/tenants?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/tenants?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:21.459'),(11,1,'GET /api/contests?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:45.955'),(12,1,'GET /api/tenants?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/tenants?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:45.963'),(13,1,'GET /api/judges-management?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/judges-management?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:47.376'),(14,1,'GET /api/contests?contestName=&contestType=individual&page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?contestName=&contestType=individual&page=1&pageSize=10\",\"query\":{\"contestName\":\"\",\"contestType\":\"individual\",\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:47.931'),(15,1,'GET /api/contests?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:48.345'),(16,1,'GET /api/tenants?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/tenants?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:02:48.358'),(17,2,'GET /api/menus/user-menus','{\"method\":\"GET\",\"url\":\"/api/menus/user-menus\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:06.092'),(18,2,'GET /api/contests/my-contests?page=1&pageSize=12&role=student','{\"method\":\"GET\",\"url\":\"/api/contests/my-contests?page=1&pageSize=12&role=student\",\"query\":{\"page\":\"1\",\"pageSize\":\"12\",\"role\":\"student\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:06.395'),(19,2,'GET /api/schools','{\"method\":\"GET\",\"url\":\"/api/schools\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:08.731'),(20,2,'GET /api/homework/homeworks?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/homework/homeworks?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:10.670'),(21,2,'GET /api/homework/homeworks?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/homework/homeworks?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:10.684'),(22,2,'GET /api/homework/review-rules?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/homework/review-rules?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:11.211'),(23,2,'GET /api/users?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/users?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:12.814'),(24,2,'GET /api/roles?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/roles?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:12.816'),(25,2,'GET /api/roles?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/roles?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:13.853'),(26,2,'GET /api/permissions?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/permissions?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:13.856'),(27,2,'GET /api/users?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/users?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:15.048'),(28,2,'GET /api/roles?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/roles?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:15.050'),(29,2,'GET /api/permissions?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/permissions?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:15.798'),(30,2,'GET /api/roles?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/roles?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:15.800'),(31,2,'GET /api/roles/4','{\"method\":\"GET\",\"url\":\"/api/roles/4\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:04:23.704'),(32,1,'GET /api/auth/user-info','{\"method\":\"GET\",\"url\":\"/api/auth/user-info\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:25.687'),(33,1,'GET /api/auth/user-info','{\"method\":\"GET\",\"url\":\"/api/auth/user-info\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:25.731'),(34,1,'GET /api/menus/user-menus','{\"method\":\"GET\",\"url\":\"/api/menus/user-menus\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:25.736'),(35,1,'GET /api/menus/user-menus','{\"method\":\"GET\",\"url\":\"/api/menus/user-menus\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:25.773'),(36,1,'GET /api/contests?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:26.035'),(37,1,'GET /api/tenants?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/tenants?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:26.048'),(38,1,'GET /api/judges-management?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/judges-management?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:26.853'),(39,1,'GET /api/contests?contestName=&contestType=individual&page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?contestName=&contestType=individual&page=1&pageSize=10\",\"query\":{\"contestName\":\"\",\"contestType\":\"individual\",\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:27.413'),(40,1,'GET /api/contests?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:27.870'),(41,1,'GET /api/tenants?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/tenants?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:55:27.881'),(42,1,'GET /api/menus/user-menus','{\"method\":\"GET\",\"url\":\"/api/menus/user-menus\",\"query\":{},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:59:58.243'),(43,1,'GET /api/contests?page=1&pageSize=10','{\"method\":\"GET\",\"url\":\"/api/contests?page=1&pageSize=10\",\"query\":{\"page\":\"1\",\"pageSize\":\"10\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:59:58.840'),(44,1,'GET /api/tenants?page=1&pageSize=100','{\"method\":\"GET\",\"url\":\"/api/tenants?page=1&pageSize=100\",\"query\":{\"page\":\"1\",\"pageSize\":\"100\"},\"body\":{}}','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','2026-01-18 02:59:58.850');
/*!40000 ALTER TABLE `logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `menus`
--

DROP TABLE IF EXISTS `menus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `menus` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `icon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `component` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_id` int DEFAULT NULL,
  `permission` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sort` int NOT NULL DEFAULT '0',
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `menus_parent_id_fkey` (`parent_id`),
  KEY `menus_creator_fkey` (`creator`),
  KEY `menus_modifier_fkey` (`modifier`),
  CONSTRAINT `menus_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `menus_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `menus_parent_id_fkey` FOREIGN KEY (`parent_id`) REFERENCES `menus` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `menus`
--

LOCK TABLES `menus` WRITE;
/*!40000 ALTER TABLE `menus` DISABLE KEYS */;
INSERT INTO `menus` VALUES (1,'活动活动','/activities','FlagOutlined',NULL,NULL,'activity:read',1,1,NULL,NULL,'2026-01-18 02:00:50.341','2026-01-18 02:00:50.341'),(2,'活动列表','/activities','UnorderedListOutlined','contests/Activities',1,'activity:read',1,1,NULL,NULL,'2026-01-18 02:00:50.351','2026-01-18 02:00:50.351'),(3,'我的报名','/activities/registrations','UserAddOutlined','contests/registrations/Index',1,'registration:create',2,1,NULL,NULL,'2026-01-18 02:00:50.355','2026-01-18 02:00:50.355'),(4,'我的作品','/activities/works','FileTextOutlined','contests/works/Index',1,'work:create',3,1,NULL,NULL,'2026-01-18 02:00:50.359','2026-01-18 02:00:50.359'),(5,'学校管理','/school','BankOutlined',NULL,NULL,'school:read',2,1,NULL,NULL,'2026-01-18 02:00:50.363','2026-01-18 02:00:50.363'),(6,'学校信息','/school/schools','BankOutlined','school/schools/Index',5,'school:read',1,1,NULL,NULL,'2026-01-18 02:00:50.367','2026-01-18 02:00:50.367'),(7,'部门管理','/school/departments','ApartmentOutlined','school/departments/Index',5,'department:read',2,1,NULL,NULL,'2026-01-18 02:00:50.371','2026-01-18 02:00:50.371'),(8,'年级管理','/school/grades','AppstoreOutlined','school/grades/Index',5,'grade:read',3,1,NULL,NULL,'2026-01-18 02:00:50.373','2026-01-18 02:00:50.373'),(9,'班级管理','/school/classes','TeamOutlined','school/classes/Index',5,'class:read',4,1,NULL,NULL,'2026-01-18 02:00:50.377','2026-01-18 02:00:50.377'),(10,'教师管理','/school/teachers','UserOutlined','school/teachers/Index',5,'teacher:read',5,1,NULL,NULL,'2026-01-18 02:00:50.381','2026-01-18 02:00:50.381'),(11,'学生管理','/school/students','UsergroupAddOutlined','school/students/Index',5,'student:read',6,1,NULL,NULL,'2026-01-18 02:00:50.384','2026-01-18 02:00:50.384'),(12,'活动管理','/contests','TrophyOutlined',NULL,NULL,'contest:create',3,1,NULL,NULL,'2026-01-18 02:00:50.388','2026-01-18 02:00:50.388'),(13,'活动列表','/contests','UnorderedListOutlined','contests/Index',12,'contest:create',1,1,NULL,NULL,'2026-01-18 02:00:50.391','2026-01-18 02:00:50.391'),(14,'评委管理','/contests/judges','SolutionOutlined','contests/judges/Index',12,'judge:read',2,1,NULL,NULL,'2026-01-18 02:00:50.396','2026-01-18 02:00:50.396'),(15,'报名管理','/contests/registrations','UserAddOutlined','contests/registrations/Index',12,'registration:approve',3,1,NULL,NULL,'2026-01-18 02:00:50.399','2026-01-18 02:00:50.399'),(16,'作品管理','/contests/works','FileTextOutlined','contests/works/Index',12,'contest:read',4,1,NULL,NULL,'2026-01-18 02:00:50.402','2026-01-18 02:00:50.402'),(17,'评审进度','/contests/review-progress','AuditOutlined','contests/reviews/Progress',12,'review-rule:read',5,1,NULL,NULL,'2026-01-18 02:00:50.404','2026-01-18 02:00:50.404'),(18,'评审规则','/contests/reviews','CheckCircleOutlined','contests/reviews/Index',12,'review-rule:read',6,1,NULL,NULL,'2026-01-18 02:00:50.407','2026-01-18 02:00:50.407'),(19,'成果发布','/contests/results','TrophyOutlined','contests/results/Index',12,'contest:create',7,1,NULL,NULL,'2026-01-18 02:00:50.412','2026-01-18 02:00:50.412'),(20,'通知管理','/contests/notices','BellOutlined','contests/notices/Index',12,'notice:create',8,1,NULL,NULL,'2026-01-18 02:00:50.416','2026-01-18 02:00:50.416'),(21,'作业管理','/homework','FormOutlined',NULL,NULL,'homework:read',4,1,NULL,NULL,'2026-01-18 02:00:50.419','2026-01-18 02:00:50.419'),(22,'作业列表','/homework','FileTextOutlined','homework/Index',21,'homework:create',1,1,NULL,NULL,'2026-01-18 02:00:50.422','2026-01-18 02:00:50.422'),(23,'评审规则','/homework/review-rules','CheckCircleOutlined','homework/ReviewRules',21,'homework-review-rule:read',2,1,NULL,NULL,'2026-01-18 02:00:50.424','2026-01-18 02:00:50.424'),(24,'我的作业','/homework/my','BookOutlined','homework/StudentList',21,'homework-submission:create',3,1,NULL,NULL,'2026-01-18 02:00:50.429','2026-01-18 02:00:50.429'),(25,'系统管理','/system','SettingOutlined',NULL,NULL,'user:read',9,1,NULL,NULL,'2026-01-18 02:00:50.432','2026-01-18 02:00:50.432'),(26,'用户管理','/system/users','UserOutlined','system/users/Index',25,'user:read',1,1,NULL,NULL,'2026-01-18 02:00:50.436','2026-01-18 02:00:50.436'),(27,'角色管理','/system/roles','TeamOutlined','system/roles/Index',25,'role:read',2,1,NULL,NULL,'2026-01-18 02:00:50.438','2026-01-18 02:00:50.438'),(28,'菜单管理','/system/menus','MenuOutlined','system/menus/Index',25,'menu:read',3,1,NULL,NULL,'2026-01-18 02:00:50.442','2026-01-18 02:00:50.442'),(29,'数据字典','/system/dict','BookOutlined','system/dict/Index',25,'dict:read',4,1,NULL,NULL,'2026-01-18 02:00:50.446','2026-01-18 02:00:50.446'),(30,'系统配置','/system/config','ToolOutlined','system/config/Index',25,'config:read',5,1,NULL,NULL,'2026-01-18 02:00:50.450','2026-01-18 02:00:50.450'),(31,'日志记录','/system/logs','FileTextOutlined','system/logs/Index',25,'log:read',6,1,NULL,NULL,'2026-01-18 02:00:50.453','2026-01-18 02:00:50.453'),(32,'权限管理','/system/permissions','SafetyOutlined','system/permissions/Index',25,'permission:read',7,1,NULL,NULL,'2026-01-18 02:00:50.457','2026-01-18 02:00:50.457'),(33,'租户管理','/system/tenants','TeamOutlined','system/tenants/Index',25,'tenant:read',8,1,NULL,NULL,'2026-01-18 02:00:50.462','2026-01-18 02:00:50.462'),(34,'工作台','/workbench','DashboardOutlined',NULL,NULL,'ai-3d:read',10,1,NULL,NULL,'2026-01-18 02:00:50.465','2026-01-18 02:00:50.465'),(35,'3D建模实验室','/workbench/3d-lab','ExperimentOutlined','workbench/ai-3d/Index',34,'ai-3d:read',1,1,NULL,NULL,'2026-01-18 02:00:50.469','2026-01-18 02:00:50.469');
/*!40000 ALTER TABLE `menus` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `permissions`
--

DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permissions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resource` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_tenant_id_resource_action_key` (`tenant_id`,`resource`,`action`),
  UNIQUE KEY `permissions_tenant_id_code_key` (`tenant_id`,`code`),
  KEY `permissions_creator_fkey` (`creator`),
  KEY `permissions_modifier_fkey` (`modifier`),
  CONSTRAINT `permissions_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `permissions_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `permissions_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=111 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `permissions`
--

LOCK TABLES `permissions` WRITE;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
INSERT INTO `permissions` VALUES (1,1,'查看工作台','workbench:read','workbench','read','允许查看工作台',1,NULL,NULL,'2026-01-18 02:00:40.576','2026-01-18 02:00:40.576'),(2,1,'创建用户','user:create','user','create','允许创建新用户',1,NULL,NULL,'2026-01-18 02:00:40.580','2026-01-18 02:00:40.580'),(3,1,'查看用户','user:read','user','read','允许查看用户列表和详情',1,NULL,NULL,'2026-01-18 02:00:40.583','2026-01-18 02:00:40.583'),(4,1,'更新用户','user:update','user','update','允许更新用户信息',1,NULL,NULL,'2026-01-18 02:00:40.588','2026-01-18 02:00:40.588'),(5,1,'删除用户','user:delete','user','delete','允许删除用户',1,NULL,NULL,'2026-01-18 02:00:40.591','2026-01-18 02:00:40.591'),(6,1,'创建角色','role:create','role','create','允许创建新角色',1,NULL,NULL,'2026-01-18 02:00:40.595','2026-01-18 02:00:40.595'),(7,1,'查看角色','role:read','role','read','允许查看角色列表和详情',1,NULL,NULL,'2026-01-18 02:00:40.598','2026-01-18 02:00:40.598'),(8,1,'更新角色','role:update','role','update','允许更新角色信息',1,NULL,NULL,'2026-01-18 02:00:40.601','2026-01-18 02:00:40.601'),(9,1,'删除角色','role:delete','role','delete','允许删除角色',1,NULL,NULL,'2026-01-18 02:00:40.604','2026-01-18 02:00:40.604'),(10,1,'分配角色','role:assign','role','assign','允许给用户分配角色',1,NULL,NULL,'2026-01-18 02:00:40.606','2026-01-18 02:00:40.606'),(11,1,'查看权限','permission:read','permission','read','允许查看权限列表',1,NULL,NULL,'2026-01-18 02:00:40.611','2026-01-18 02:00:40.611'),(12,1,'查看菜单','menu:read','menu','read','允许查看菜单列表',1,NULL,NULL,'2026-01-18 02:00:40.614','2026-01-18 02:00:40.614'),(13,1,'创建租户','tenant:create','tenant','create','允许创建租户',1,NULL,NULL,'2026-01-18 02:00:40.617','2026-01-18 02:00:40.617'),(14,1,'查看租户','tenant:read','tenant','read','允许查看租户列表',1,NULL,NULL,'2026-01-18 02:00:40.620','2026-01-18 02:00:40.620'),(15,1,'更新租户','tenant:update','tenant','update','允许更新租户信息',1,NULL,NULL,'2026-01-18 02:00:40.622','2026-01-18 02:00:40.622'),(16,1,'删除租户','tenant:delete','tenant','delete','允许删除租户',1,NULL,NULL,'2026-01-18 02:00:40.626','2026-01-18 02:00:40.626'),(17,1,'创建活动','contest:create','contest','create','允许创建活动',1,NULL,NULL,'2026-01-18 02:00:40.629','2026-01-18 02:00:40.629'),(18,1,'查看活动','contest:read','contest','read','允许查看活动列表',1,NULL,NULL,'2026-01-18 02:00:40.632','2026-01-18 02:00:40.632'),(19,1,'更新活动','contest:update','contest','update','允许更新活动信息',1,NULL,NULL,'2026-01-18 02:00:40.634','2026-01-18 02:00:40.634'),(20,1,'删除活动','contest:delete','contest','delete','允许删除活动',1,NULL,NULL,'2026-01-18 02:00:40.637','2026-01-18 02:00:40.637'),(21,1,'发布活动','contest:publish','contest','publish','允许发布活动',1,NULL,NULL,'2026-01-18 02:00:40.639','2026-01-18 02:00:40.639'),(22,1,'结束活动','contest:finish','contest','finish','允许结束活动',1,NULL,NULL,'2026-01-18 02:00:40.643','2026-01-18 02:00:40.643'),(23,1,'创建评审规则','review-rule:create','review-rule','create','允许创建评审规则',1,NULL,NULL,'2026-01-18 02:00:40.646','2026-01-18 02:00:40.646'),(24,1,'查看评审规则','review-rule:read','review-rule','read','允许查看评审规则',1,NULL,NULL,'2026-01-18 02:00:40.648','2026-01-18 02:00:40.648'),(25,1,'更新评审规则','review-rule:update','review-rule','update','允许更新评审规则',1,NULL,NULL,'2026-01-18 02:00:40.651','2026-01-18 02:00:40.651'),(26,1,'删除评审规则','review-rule:delete','review-rule','delete','允许删除评审规则',1,NULL,NULL,'2026-01-18 02:00:40.654','2026-01-18 02:00:40.654'),(27,1,'添加评委','judge:create','judge','create','允许添加评委',1,NULL,NULL,'2026-01-18 02:00:40.656','2026-01-18 02:00:40.656'),(28,1,'查看评委','judge:read','judge','read','允许查看评委列表',1,NULL,NULL,'2026-01-18 02:00:40.659','2026-01-18 02:00:40.659'),(29,1,'更新评委','judge:update','judge','update','允许更新评委信息',1,NULL,NULL,'2026-01-18 02:00:40.662','2026-01-18 02:00:40.662'),(30,1,'删除评委','judge:delete','judge','delete','允许删除评委',1,NULL,NULL,'2026-01-18 02:00:40.664','2026-01-18 02:00:40.664'),(31,1,'分配评委','judge:assign','judge','assign','允许为活动分配评委',1,NULL,NULL,'2026-01-18 02:00:40.667','2026-01-18 02:00:40.667'),(32,1,'查看报名','registration:read','registration','read','允许查看报名记录',1,NULL,NULL,'2026-01-18 02:00:40.669','2026-01-18 02:00:40.669'),(33,1,'审核报名','registration:approve','registration','approve','允许审核报名',1,NULL,NULL,'2026-01-18 02:00:40.672','2026-01-18 02:00:40.672'),(34,1,'查看作品','work:read','work','read','允许查看参赛作品',1,NULL,NULL,'2026-01-18 02:00:40.676','2026-01-18 02:00:40.676'),(35,1,'创建公告','notice:create','notice','create','允许创建活动公告',1,NULL,NULL,'2026-01-18 02:00:40.679','2026-01-18 02:00:40.679'),(36,1,'查看公告','notice:read','notice','read','允许查看活动公告',1,NULL,NULL,'2026-01-18 02:00:40.681','2026-01-18 02:00:40.681'),(37,1,'更新公告','notice:update','notice','update','允许更新公告信息',1,NULL,NULL,'2026-01-18 02:00:40.683','2026-01-18 02:00:40.683'),(38,1,'删除公告','notice:delete','notice','delete','允许删除公告',1,NULL,NULL,'2026-01-18 02:00:40.686','2026-01-18 02:00:40.686'),(39,1,'创建字典','dict:create','dict','create','允许创建新字典',1,NULL,NULL,'2026-01-18 02:00:40.688','2026-01-18 02:00:40.688'),(40,1,'查看字典','dict:read','dict','read','允许查看字典列表和详情',1,NULL,NULL,'2026-01-18 02:00:40.693','2026-01-18 02:00:40.693'),(41,1,'更新字典','dict:update','dict','update','允许更新字典信息',1,NULL,NULL,'2026-01-18 02:00:40.696','2026-01-18 02:00:40.696'),(42,1,'删除字典','dict:delete','dict','delete','允许删除字典',1,NULL,NULL,'2026-01-18 02:00:40.698','2026-01-18 02:00:40.698'),(43,1,'创建配置','config:create','config','create','允许创建新配置',1,NULL,NULL,'2026-01-18 02:00:40.701','2026-01-18 02:00:40.701'),(44,1,'查看配置','config:read','config','read','允许查看配置列表和详情',1,NULL,NULL,'2026-01-18 02:00:40.704','2026-01-18 02:00:40.704'),(45,1,'更新配置','config:update','config','update','允许更新配置信息',1,NULL,NULL,'2026-01-18 02:00:40.707','2026-01-18 02:00:40.707'),(46,1,'删除配置','config:delete','config','delete','允许删除配置',1,NULL,NULL,'2026-01-18 02:00:40.711','2026-01-18 02:00:40.711'),(47,1,'查看日志','log:read','log','read','允许查看系统日志',1,NULL,NULL,'2026-01-18 02:00:40.714','2026-01-18 02:00:40.714'),(48,1,'删除日志','log:delete','log','delete','允许删除系统日志',1,NULL,NULL,'2026-01-18 02:00:40.716','2026-01-18 02:00:40.716'),(49,2,'查看工作台','workbench:read','workbench','read','允许查看工作台',1,NULL,NULL,'2026-01-18 02:03:25.311','2026-01-18 02:03:25.311'),(50,2,'创建用户','user:create','user','create','允许创建新用户',1,NULL,NULL,'2026-01-18 02:03:25.315','2026-01-18 02:03:25.315'),(51,2,'查看用户','user:read','user','read','允许查看用户列表和详情',1,NULL,NULL,'2026-01-18 02:03:25.318','2026-01-18 02:03:25.318'),(52,2,'更新用户','user:update','user','update','允许更新用户信息',1,NULL,NULL,'2026-01-18 02:03:25.321','2026-01-18 02:03:25.321'),(53,2,'删除用户','user:delete','user','delete','允许删除用户',1,NULL,NULL,'2026-01-18 02:03:25.323','2026-01-18 02:03:25.323'),(54,2,'创建角色','role:create','role','create','允许创建新角色',1,NULL,NULL,'2026-01-18 02:03:25.326','2026-01-18 02:03:25.326'),(55,2,'查看角色','role:read','role','read','允许查看角色列表和详情',1,NULL,NULL,'2026-01-18 02:03:25.329','2026-01-18 02:03:25.329'),(56,2,'更新角色','role:update','role','update','允许更新角色信息',1,NULL,NULL,'2026-01-18 02:03:25.333','2026-01-18 02:03:25.333'),(57,2,'删除角色','role:delete','role','delete','允许删除角色',1,NULL,NULL,'2026-01-18 02:03:25.337','2026-01-18 02:03:25.337'),(58,2,'分配角色','role:assign','role','assign','允许给用户分配角色',1,NULL,NULL,'2026-01-18 02:03:25.340','2026-01-18 02:03:25.340'),(59,2,'查看权限','permission:read','permission','read','允许查看权限列表',1,NULL,NULL,'2026-01-18 02:03:25.342','2026-01-18 02:03:25.342'),(60,2,'查看菜单','menu:read','menu','read','允许查看菜单列表',1,NULL,NULL,'2026-01-18 02:03:25.345','2026-01-18 02:03:25.345'),(61,2,'创建学校','school:create','school','create','允许创建学校信息',1,NULL,NULL,'2026-01-18 02:03:25.349','2026-01-18 02:03:25.349'),(62,2,'查看学校','school:read','school','read','允许查看学校信息',1,NULL,NULL,'2026-01-18 02:03:25.352','2026-01-18 02:03:25.352'),(63,2,'更新学校','school:update','school','update','允许更新学校信息',1,NULL,NULL,'2026-01-18 02:03:25.355','2026-01-18 02:03:25.355'),(64,2,'删除学校','school:delete','school','delete','允许删除学校信息',1,NULL,NULL,'2026-01-18 02:03:25.357','2026-01-18 02:03:25.357'),(65,2,'创建部门','department:create','department','create','允许创建部门',1,NULL,NULL,'2026-01-18 02:03:25.360','2026-01-18 02:03:25.360'),(66,2,'查看部门','department:read','department','read','允许查看部门列表',1,NULL,NULL,'2026-01-18 02:03:25.363','2026-01-18 02:03:25.363'),(67,2,'更新部门','department:update','department','update','允许更新部门信息',1,NULL,NULL,'2026-01-18 02:03:25.366','2026-01-18 02:03:25.366'),(68,2,'删除部门','department:delete','department','delete','允许删除部门',1,NULL,NULL,'2026-01-18 02:03:25.369','2026-01-18 02:03:25.369'),(69,2,'创建年级','grade:create','grade','create','允许创建年级',1,NULL,NULL,'2026-01-18 02:03:25.372','2026-01-18 02:03:25.372'),(70,2,'查看年级','grade:read','grade','read','允许查看年级列表',1,NULL,NULL,'2026-01-18 02:03:25.374','2026-01-18 02:03:25.374'),(71,2,'更新年级','grade:update','grade','update','允许更新年级信息',1,NULL,NULL,'2026-01-18 02:03:25.378','2026-01-18 02:03:25.378'),(72,2,'删除年级','grade:delete','grade','delete','允许删除年级',1,NULL,NULL,'2026-01-18 02:03:25.381','2026-01-18 02:03:25.381'),(73,2,'创建班级','class:create','class','create','允许创建班级',1,NULL,NULL,'2026-01-18 02:03:25.384','2026-01-18 02:03:25.384'),(74,2,'查看班级','class:read','class','read','允许查看班级列表',1,NULL,NULL,'2026-01-18 02:03:25.387','2026-01-18 02:03:25.387'),(75,2,'更新班级','class:update','class','update','允许更新班级信息',1,NULL,NULL,'2026-01-18 02:03:25.389','2026-01-18 02:03:25.389'),(76,2,'删除班级','class:delete','class','delete','允许删除班级',1,NULL,NULL,'2026-01-18 02:03:25.392','2026-01-18 02:03:25.392'),(77,2,'创建教师','teacher:create','teacher','create','允许创建教师',1,NULL,NULL,'2026-01-18 02:03:25.396','2026-01-18 02:03:25.396'),(78,2,'查看教师','teacher:read','teacher','read','允许查看教师列表',1,NULL,NULL,'2026-01-18 02:03:25.399','2026-01-18 02:03:25.399'),(79,2,'更新教师','teacher:update','teacher','update','允许更新教师信息',1,NULL,NULL,'2026-01-18 02:03:25.401','2026-01-18 02:03:25.401'),(80,2,'删除教师','teacher:delete','teacher','delete','允许删除教师',1,NULL,NULL,'2026-01-18 02:03:25.404','2026-01-18 02:03:25.404'),(81,2,'创建学生','student:create','student','create','允许创建学生',1,NULL,NULL,'2026-01-18 02:03:25.406','2026-01-18 02:03:25.406'),(82,2,'查看学生','student:read','student','read','允许查看学生列表',1,NULL,NULL,'2026-01-18 02:03:25.408','2026-01-18 02:03:25.408'),(83,2,'更新学生','student:update','student','update','允许更新学生信息',1,NULL,NULL,'2026-01-18 02:03:25.410','2026-01-18 02:03:25.410'),(84,2,'删除学生','student:delete','student','delete','允许删除学生',1,NULL,NULL,'2026-01-18 02:03:25.412','2026-01-18 02:03:25.412'),(85,2,'查看活动活动','activity:read','activity','read','允许查看已发布的活动活动',1,NULL,NULL,'2026-01-18 02:03:25.414','2026-01-18 02:03:25.414'),(86,2,'指导学生','activity:guidance','activity','guidance','允许指导学生参赛',1,NULL,NULL,'2026-01-18 02:03:25.416','2026-01-18 02:03:25.416'),(87,2,'创建报名','registration:create','registration','create','允许报名活动',1,NULL,NULL,'2026-01-18 02:03:25.418','2026-01-18 02:03:25.418'),(88,2,'查看报名','registration:read','registration','read','允许查看报名记录',1,NULL,NULL,'2026-01-18 02:03:25.420','2026-01-18 02:03:25.420'),(89,2,'更新报名','registration:update','registration','update','允许更新报名信息',1,NULL,NULL,'2026-01-18 02:03:25.422','2026-01-18 02:03:25.422'),(90,2,'取消报名','registration:delete','registration','delete','允许取消报名',1,NULL,NULL,'2026-01-18 02:03:25.424','2026-01-18 02:03:25.424'),(91,2,'上传作品','work:create','work','create','允许上传参赛作品',1,NULL,NULL,'2026-01-18 02:03:25.427','2026-01-18 02:03:25.427'),(92,2,'查看作品','work:read','work','read','允许查看参赛作品',1,NULL,NULL,'2026-01-18 02:03:25.429','2026-01-18 02:03:25.429'),(93,2,'更新作品','work:update','work','update','允许更新作品信息',1,NULL,NULL,'2026-01-18 02:03:25.431','2026-01-18 02:03:25.431'),(94,2,'删除作品','work:delete','work','delete','允许删除作品',1,NULL,NULL,'2026-01-18 02:03:25.433','2026-01-18 02:03:25.433'),(95,2,'提交作品','work:submit','work','submit','允许提交作品',1,NULL,NULL,'2026-01-18 02:03:25.435','2026-01-18 02:03:25.435'),(96,2,'查看公告','notice:read','notice','read','允许查看活动公告',1,NULL,NULL,'2026-01-18 02:03:25.437','2026-01-18 02:03:25.437'),(97,2,'创建作业','homework:create','homework','create','允许创建作业',1,NULL,NULL,'2026-01-18 02:03:25.439','2026-01-18 02:03:25.439'),(98,2,'查看作业','homework:read','homework','read','允许查看作业列表',1,NULL,NULL,'2026-01-18 02:03:25.442','2026-01-18 02:03:25.442'),(99,2,'更新作业','homework:update','homework','update','允许更新作业信息',1,NULL,NULL,'2026-01-18 02:03:25.445','2026-01-18 02:03:25.445'),(100,2,'删除作业','homework:delete','homework','delete','允许删除作业',1,NULL,NULL,'2026-01-18 02:03:25.448','2026-01-18 02:03:25.448'),(101,2,'发布作业','homework:publish','homework','publish','允许发布作业',1,NULL,NULL,'2026-01-18 02:03:25.450','2026-01-18 02:03:25.450'),(102,2,'提交作业','homework-submission:create','homework-submission','create','允许提交作业',1,NULL,NULL,'2026-01-18 02:03:25.452','2026-01-18 02:03:25.452'),(103,2,'查看作业提交','homework-submission:read','homework-submission','read','允许查看作业提交记录',1,NULL,NULL,'2026-01-18 02:03:25.454','2026-01-18 02:03:25.454'),(104,2,'更新作业提交','homework-submission:update','homework-submission','update','允许更新提交的作业',1,NULL,NULL,'2026-01-18 02:03:25.456','2026-01-18 02:03:25.456'),(105,2,'创建作业评审规则','homework-review-rule:create','homework-review-rule','create','允许创建作业评审规则',1,NULL,NULL,'2026-01-18 02:03:25.460','2026-01-18 02:03:25.460'),(106,2,'查看作业评审规则','homework-review-rule:read','homework-review-rule','read','允许查看作业评审规则',1,NULL,NULL,'2026-01-18 02:03:25.462','2026-01-18 02:03:25.462'),(107,2,'更新作业评审规则','homework-review-rule:update','homework-review-rule','update','允许更新作业评审规则',1,NULL,NULL,'2026-01-18 02:03:25.465','2026-01-18 02:03:25.465'),(108,2,'删除作业评审规则','homework-review-rule:delete','homework-review-rule','delete','允许删除作业评审规则',1,NULL,NULL,'2026-01-18 02:03:25.467','2026-01-18 02:03:25.467'),(109,2,'作业评分','homework-score:create','homework-score','create','允许对作业评分',1,NULL,NULL,'2026-01-18 02:03:25.470','2026-01-18 02:03:25.470'),(110,2,'查看作业评分','homework-score:read','homework-score','read','允许查看作业评分',1,NULL,NULL,'2026-01-18 02:03:25.472','2026-01-18 02:03:25.472');
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `role_permissions`
--

DROP TABLE IF EXISTS `role_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `role_permissions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `role_id` int NOT NULL,
  `permission_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_permissions_role_id_permission_id_key` (`role_id`,`permission_id`),
  KEY `role_permissions_permission_id_fkey` (`permission_id`),
  CONSTRAINT `role_permissions_permission_id_fkey` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `role_permissions_role_id_fkey` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `role_permissions`
--

LOCK TABLES `role_permissions` WRITE;
/*!40000 ALTER TABLE `role_permissions` DISABLE KEYS */;
INSERT INTO `role_permissions` VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4),(5,1,5),(6,1,6),(7,1,7),(8,1,8),(9,1,9),(10,1,10),(11,1,11),(12,1,12),(13,1,13),(14,1,14),(15,1,15),(16,1,16),(17,1,17),(18,1,18),(19,1,19),(20,1,20),(21,1,21),(22,1,22),(23,1,23),(24,1,24),(25,1,25),(26,1,26),(27,1,27),(28,1,28),(29,1,29),(30,1,30),(31,1,31),(32,1,32),(33,1,33),(34,1,34),(35,1,35),(36,1,36),(37,1,37),(38,1,38),(39,1,39),(40,1,40),(41,1,41),(42,1,42),(43,1,43),(44,1,44),(45,1,45),(46,1,46),(47,1,47),(48,1,48),(49,2,49),(50,2,50),(51,2,51),(52,2,52),(53,2,53),(54,2,54),(55,2,55),(56,2,56),(57,2,57),(58,2,58),(59,2,59),(60,2,60),(61,2,61),(62,2,62),(63,2,63),(64,2,64),(65,2,65),(66,2,66),(67,2,67),(68,2,68),(69,2,69),(70,2,70),(71,2,71),(72,2,72),(73,2,73),(74,2,74),(75,2,75),(76,2,76),(77,2,77),(78,2,78),(79,2,79),(80,2,80),(81,2,81),(82,2,82),(83,2,83),(84,2,84),(85,2,85),(87,2,88),(88,2,92),(86,2,96),(89,2,97),(90,2,98),(91,2,99),(92,2,100),(93,2,101),(94,2,103),(95,2,105),(96,2,106),(97,2,107),(98,2,108),(99,2,110),(100,3,49),(101,3,70),(102,3,74),(103,3,82),(104,3,85),(105,3,86),(107,3,87),(108,3,88),(109,3,89),(110,3,90),(111,3,91),(112,3,92),(113,3,93),(114,3,95),(106,3,96),(115,3,97),(116,3,98),(117,3,99),(118,3,100),(119,3,101),(120,3,103),(121,3,105),(122,3,106),(123,3,107),(124,3,108),(125,3,109),(126,3,110),(127,4,49),(128,4,85),(130,4,88),(131,4,91),(132,4,92),(133,4,93),(134,4,95),(129,4,96),(135,4,98),(136,4,102),(137,4,103),(138,4,104),(139,4,110);
/*!40000 ALTER TABLE `role_permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `roles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_tenant_id_name_key` (`tenant_id`,`name`),
  UNIQUE KEY `roles_tenant_id_code_key` (`tenant_id`,`code`),
  KEY `roles_creator_fkey` (`creator`),
  KEY `roles_modifier_fkey` (`modifier`),
  CONSTRAINT `roles_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `roles_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `roles_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `roles`
--

LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,1,'超级管理员','super_admin','拥有系统所有权限的超级管理员角色',1,NULL,NULL,'2026-01-18 02:00:23.928','2026-01-18 02:00:40.723'),(2,2,'学校管理员','school_admin','学校管理员，管理学校信息、教师、学生等',1,NULL,NULL,'2026-01-18 02:03:25.475','2026-01-18 02:03:25.475'),(3,2,'教师','teacher','教师角色，可以报名活动、指导学生、管理作业',1,NULL,NULL,'2026-01-18 02:03:25.596','2026-01-18 02:03:25.596'),(4,2,'学生','student','学生角色，可以查看活动、上传作品、提交作业',1,NULL,NULL,'2026-01-18 02:03:25.666','2026-01-18 02:03:25.666');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `schools`
--

DROP TABLE IF EXISTS `schools`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `schools` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `principal` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `established` datetime(3) DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `schools_tenant_id_key` (`tenant_id`),
  KEY `schools_creator_fkey` (`creator`),
  KEY `schools_modifier_fkey` (`modifier`),
  CONSTRAINT `schools_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `schools_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `schools_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `schools`
--

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

--
-- Table structure for table `student_interest_classes`
--

DROP TABLE IF EXISTS `student_interest_classes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `student_interest_classes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `student_id` int NOT NULL,
  `class_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `student_interest_classes_student_id_class_id_key` (`student_id`,`class_id`),
  KEY `student_interest_classes_class_id_fkey` (`class_id`),
  CONSTRAINT `student_interest_classes_class_id_fkey` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `student_interest_classes_student_id_fkey` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `student_interest_classes`
--

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

--
-- Table structure for table `students`
--

DROP TABLE IF EXISTS `students`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `students` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `tenant_id` int NOT NULL,
  `class_id` int NOT NULL,
  `student_no` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_card` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` int DEFAULT NULL,
  `birth_date` datetime(3) DEFAULT NULL,
  `enrollment_date` datetime(3) DEFAULT NULL,
  `parent_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `students_user_id_key` (`user_id`),
  UNIQUE KEY `students_tenant_id_student_no_key` (`tenant_id`,`student_no`),
  KEY `students_class_id_fkey` (`class_id`),
  KEY `students_creator_fkey` (`creator`),
  KEY `students_modifier_fkey` (`modifier`),
  CONSTRAINT `students_class_id_fkey` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `students_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `students_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `students_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `students_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `students`
--

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

--
-- Table structure for table `t_ai_3d_task`
--

DROP TABLE IF EXISTS `t_ai_3d_task`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_ai_3d_task` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `user_id` int NOT NULL,
  `input_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `input_content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `generate_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Normal',
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `result_url` text COLLATE utf8mb4_unicode_ci,
  `preview_url` text COLLATE utf8mb4_unicode_ci,
  `result_urls` json DEFAULT NULL,
  `preview_urls` json DEFAULT NULL,
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `external_task_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `retry_count` int NOT NULL DEFAULT '0',
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `complete_time` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `t_ai_3d_task_user_id_idx` (`user_id`),
  KEY `t_ai_3d_task_tenant_id_idx` (`tenant_id`),
  KEY `t_ai_3d_task_status_idx` (`status`),
  KEY `t_ai_3d_task_create_time_idx` (`create_time`),
  CONSTRAINT `t_ai_3d_task_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_ai_3d_task_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_ai_3d_task`
--

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

--
-- Table structure for table `t_contest`
--

DROP TABLE IF EXISTS `t_contest`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest` (
  `id` int NOT NULL AUTO_INCREMENT,
  `contest_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contest_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contest_state` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpublished',
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ongoing',
  `start_time` datetime(3) NOT NULL,
  `end_time` datetime(3) NOT NULL,
  `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `contest_tenants` json DEFAULT NULL,
  `cover_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `poster_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_qrcode` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `organizers` json DEFAULT NULL,
  `co_organizers` json DEFAULT NULL,
  `sponsors` json DEFAULT NULL,
  `register_start_time` datetime(3) NOT NULL,
  `register_end_time` datetime(3) NOT NULL,
  `register_state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `require_audit` tinyint(1) NOT NULL DEFAULT '1',
  `allowed_grades` json DEFAULT NULL,
  `allowed_classes` json DEFAULT NULL,
  `team_min_members` int DEFAULT NULL,
  `team_max_members` int DEFAULT NULL,
  `submit_rule` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'once',
  `submit_start_time` datetime(3) NOT NULL,
  `submit_end_time` datetime(3) NOT NULL,
  `work_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `work_requirement` text COLLATE utf8mb4_unicode_ci,
  `review_rule_id` int DEFAULT NULL,
  `review_start_time` datetime(3) NOT NULL,
  `review_end_time` datetime(3) NOT NULL,
  `result_state` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpublished',
  `result_publish_time` datetime(3) DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_contest_contest_name_key` (`contest_name`),
  KEY `t_contest_contest_state_idx` (`contest_state`),
  KEY `t_contest_start_time_end_time_idx` (`start_time`,`end_time`),
  KEY `t_contest_review_rule_id_idx` (`review_rule_id`),
  KEY `t_contest_creator_fkey` (`creator`),
  KEY `t_contest_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_review_rule_id_fkey` FOREIGN KEY (`review_rule_id`) REFERENCES `t_contest_review_rule` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest`
--

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

--
-- Table structure for table `t_contest_attachment`
--

DROP TABLE IF EXISTS `t_contest_attachment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_attachment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `contest_id` int NOT NULL,
  `file_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `format` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `t_contest_attachment_contest_id_idx` (`contest_id`),
  KEY `t_contest_attachment_creator_fkey` (`creator`),
  KEY `t_contest_attachment_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_attachment_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_attachment_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_attachment_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_attachment`
--

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

--
-- Table structure for table `t_contest_judge`
--

DROP TABLE IF EXISTS `t_contest_judge`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_judge` (
  `id` int NOT NULL AUTO_INCREMENT,
  `contest_id` int NOT NULL,
  `judge_id` int NOT NULL,
  `specialty` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight` decimal(3,2) DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_contest_judge_contest_id_judge_id_key` (`contest_id`,`judge_id`),
  KEY `t_contest_judge_contest_id_idx` (`contest_id`),
  KEY `t_contest_judge_judge_id_idx` (`judge_id`),
  KEY `t_contest_judge_creator_fkey` (`creator`),
  KEY `t_contest_judge_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_judge_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_judge_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_judge_judge_id_fkey` FOREIGN KEY (`judge_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_judge_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_judge`
--

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

--
-- Table structure for table `t_contest_notice`
--

DROP TABLE IF EXISTS `t_contest_notice`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_notice` (
  `id` int NOT NULL AUTO_INCREMENT,
  `contest_id` int NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `notice_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'manual',
  `priority` int NOT NULL DEFAULT '0',
  `publish_time` datetime(3) DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `t_contest_notice_contest_id_idx` (`contest_id`),
  KEY `t_contest_notice_publish_time_idx` (`publish_time`),
  KEY `t_contest_notice_notice_type_idx` (`notice_type`),
  KEY `t_contest_notice_creator_fkey` (`creator`),
  KEY `t_contest_notice_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_notice_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_notice_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_notice_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_notice`
--

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

--
-- Table structure for table `t_contest_registration`
--

DROP TABLE IF EXISTS `t_contest_registration`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_registration` (
  `id` int NOT NULL AUTO_INCREMENT,
  `contest_id` int NOT NULL,
  `tenant_id` int NOT NULL,
  `registration_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `team_id` int DEFAULT NULL,
  `team_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` int NOT NULL,
  `account_no` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `registration_state` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `registrant` int DEFAULT NULL,
  `registration_time` datetime(3) NOT NULL,
  `reason` varchar(1023) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `operator` int DEFAULT NULL,
  `operation_date` datetime(3) DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `t_contest_registration_contest_id_tenant_id_idx` (`contest_id`,`tenant_id`),
  KEY `t_contest_registration_user_id_contest_id_idx` (`user_id`,`contest_id`),
  KEY `t_contest_registration_team_id_idx` (`team_id`),
  KEY `t_contest_registration_registration_state_idx` (`registration_state`),
  KEY `t_contest_registration_tenant_id_fkey` (`tenant_id`),
  KEY `t_contest_registration_creator_fkey` (`creator`),
  KEY `t_contest_registration_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_registration_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_team_id_fkey` FOREIGN KEY (`team_id`) REFERENCES `t_contest_team` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_registration`
--

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

--
-- Table structure for table `t_contest_registration_teacher`
--

DROP TABLE IF EXISTS `t_contest_registration_teacher`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_registration_teacher` (
  `id` int NOT NULL AUTO_INCREMENT,
  `registration_id` int NOT NULL,
  `tenant_id` int NOT NULL,
  `user_id` int NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_contest_registration_teacher_tenant_id_registration_id_use_key` (`tenant_id`,`registration_id`,`user_id`),
  KEY `t_contest_registration_teacher_registration_id_idx` (`registration_id`),
  KEY `t_contest_registration_teacher_user_id_idx` (`user_id`),
  KEY `t_contest_registration_teacher_creator_fkey` (`creator`),
  KEY `t_contest_registration_teacher_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_registration_teacher_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_teacher_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_teacher_registration_id_fkey` FOREIGN KEY (`registration_id`) REFERENCES `t_contest_registration` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_teacher_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_registration_teacher_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_registration_teacher`
--

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

--
-- Table structure for table `t_contest_review_rule`
--

DROP TABLE IF EXISTS `t_contest_review_rule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_review_rule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `rule_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rule_description` text COLLATE utf8mb4_unicode_ci,
  `judge_count` int DEFAULT NULL,
  `dimensions` json NOT NULL,
  `calculation_rule` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'average',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `t_contest_review_rule_tenant_id_idx` (`tenant_id`),
  KEY `t_contest_review_rule_creator_fkey` (`creator`),
  KEY `t_contest_review_rule_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_review_rule_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_review_rule_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_review_rule_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_review_rule`
--

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

--
-- Table structure for table `t_contest_team`
--

DROP TABLE IF EXISTS `t_contest_team`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_team` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `contest_id` int NOT NULL,
  `team_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `leader_user_id` int NOT NULL,
  `max_members` int DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_contest_team_tenant_id_contest_id_team_name_key` (`tenant_id`,`contest_id`,`team_name`),
  KEY `t_contest_team_contest_id_idx` (`contest_id`),
  KEY `t_contest_team_leader_user_id_idx` (`leader_user_id`),
  KEY `t_contest_team_creator_fkey` (`creator`),
  KEY `t_contest_team_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_team_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_leader_user_id_fkey` FOREIGN KEY (`leader_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_team`
--

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

--
-- Table structure for table `t_contest_team_member`
--

DROP TABLE IF EXISTS `t_contest_team_member`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_team_member` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `team_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'member',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_contest_team_member_tenant_id_team_id_user_id_key` (`tenant_id`,`team_id`,`user_id`),
  KEY `t_contest_team_member_team_id_idx` (`team_id`),
  KEY `t_contest_team_member_user_id_idx` (`user_id`),
  KEY `t_contest_team_member_creator_fkey` (`creator`),
  KEY `t_contest_team_member_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_team_member_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_member_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_member_team_id_fkey` FOREIGN KEY (`team_id`) REFERENCES `t_contest_team` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_member_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_team_member_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_team_member`
--

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

--
-- Table structure for table `t_contest_work`
--

DROP TABLE IF EXISTS `t_contest_work`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_work` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `contest_id` int NOT NULL,
  `registration_id` int NOT NULL,
  `work_no` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `files` json DEFAULT NULL,
  `version` int NOT NULL DEFAULT '1',
  `is_latest` tinyint(1) NOT NULL DEFAULT '1',
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'submitted',
  `submit_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `submitter_user_id` int DEFAULT NULL,
  `submitter_account_no` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `submit_source` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'teacher',
  `preview_url` text COLLATE utf8mb4_unicode_ci,
  `preview_urls` json DEFAULT NULL,
  `ai_model_meta` json DEFAULT NULL,
  `final_score` decimal(10,2) DEFAULT NULL,
  `rank` int DEFAULT NULL,
  `award_level` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `award_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `certificate_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_contest_work_work_no_key` (`work_no`),
  KEY `t_contest_work_tenant_id_contest_id_is_latest_idx` (`tenant_id`,`contest_id`,`is_latest`),
  KEY `t_contest_work_registration_id_idx` (`registration_id`),
  KEY `t_contest_work_tenant_id_contest_id_submit_time_status_idx` (`tenant_id`,`contest_id`,`submit_time`,`status`),
  KEY `t_contest_work_contest_id_status_idx` (`contest_id`,`status`),
  KEY `t_contest_work_creator_fkey` (`creator`),
  KEY `t_contest_work_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_work_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_registration_id_fkey` FOREIGN KEY (`registration_id`) REFERENCES `t_contest_registration` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_work`
--

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

--
-- Table structure for table `t_contest_work_attachment`
--

DROP TABLE IF EXISTS `t_contest_work_attachment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_work_attachment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `contest_id` int NOT NULL,
  `work_id` int NOT NULL,
  `file_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `format` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `t_contest_work_attachment_tenant_id_contest_id_work_id_idx` (`tenant_id`,`contest_id`,`work_id`),
  KEY `t_contest_work_attachment_work_id_fkey` (`work_id`),
  KEY `t_contest_work_attachment_creator_fkey` (`creator`),
  KEY `t_contest_work_attachment_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_work_attachment_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_attachment_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_attachment_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_attachment_work_id_fkey` FOREIGN KEY (`work_id`) REFERENCES `t_contest_work` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_work_attachment`
--

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

--
-- Table structure for table `t_contest_work_judge_assignment`
--

DROP TABLE IF EXISTS `t_contest_work_judge_assignment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_work_judge_assignment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `contest_id` int NOT NULL,
  `work_id` int NOT NULL,
  `judge_id` int NOT NULL,
  `assignment_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'assigned',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_contest_work_judge_assignment_work_id_judge_id_key` (`work_id`,`judge_id`),
  KEY `t_contest_work_judge_assignment_contest_id_judge_id_idx` (`contest_id`,`judge_id`),
  KEY `t_contest_work_judge_assignment_work_id_idx` (`work_id`),
  KEY `t_contest_work_judge_assignment_status_idx` (`status`),
  KEY `t_contest_work_judge_assignment_judge_id_fkey` (`judge_id`),
  KEY `t_contest_work_judge_assignment_creator_fkey` (`creator`),
  KEY `t_contest_work_judge_assignment_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_work_judge_assignment_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_judge_assignment_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_judge_assignment_judge_id_fkey` FOREIGN KEY (`judge_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_judge_assignment_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_judge_assignment_work_id_fkey` FOREIGN KEY (`work_id`) REFERENCES `t_contest_work` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_work_judge_assignment`
--

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

--
-- Table structure for table `t_contest_work_score`
--

DROP TABLE IF EXISTS `t_contest_work_score`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_contest_work_score` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `contest_id` int NOT NULL,
  `work_id` int NOT NULL,
  `assignment_id` int NOT NULL,
  `judge_id` int NOT NULL,
  `judge_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dimension_scores` json NOT NULL,
  `total_score` decimal(10,2) NOT NULL,
  `comments` text COLLATE utf8mb4_unicode_ci,
  `score_time` datetime(3) NOT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `t_contest_work_score_contest_id_work_id_judge_id_idx` (`contest_id`,`work_id`,`judge_id`),
  KEY `t_contest_work_score_work_id_idx` (`work_id`),
  KEY `t_contest_work_score_assignment_id_idx` (`assignment_id`),
  KEY `t_contest_work_score_tenant_id_fkey` (`tenant_id`),
  KEY `t_contest_work_score_judge_id_fkey` (`judge_id`),
  KEY `t_contest_work_score_creator_fkey` (`creator`),
  KEY `t_contest_work_score_modifier_fkey` (`modifier`),
  CONSTRAINT `t_contest_work_score_assignment_id_fkey` FOREIGN KEY (`assignment_id`) REFERENCES `t_contest_work_judge_assignment` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_score_contest_id_fkey` FOREIGN KEY (`contest_id`) REFERENCES `t_contest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_score_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_score_judge_id_fkey` FOREIGN KEY (`judge_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_score_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_score_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_contest_work_score_work_id_fkey` FOREIGN KEY (`work_id`) REFERENCES `t_contest_work` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_contest_work_score`
--

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

--
-- Table structure for table `t_homework`
--

DROP TABLE IF EXISTS `t_homework`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_homework` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpublished',
  `publish_time` datetime(3) DEFAULT NULL,
  `submit_start_time` datetime(3) NOT NULL,
  `submit_end_time` datetime(3) NOT NULL,
  `attachments` json DEFAULT NULL,
  `publish_scope` json DEFAULT NULL,
  `review_rule_id` int DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `t_homework_tenant_id_status_idx` (`tenant_id`,`status`),
  KEY `t_homework_tenant_id_submit_start_time_submit_end_time_idx` (`tenant_id`,`submit_start_time`,`submit_end_time`),
  KEY `t_homework_review_rule_id_fkey` (`review_rule_id`),
  KEY `t_homework_creator_fkey` (`creator`),
  KEY `t_homework_modifier_fkey` (`modifier`),
  CONSTRAINT `t_homework_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_review_rule_id_fkey` FOREIGN KEY (`review_rule_id`) REFERENCES `t_homework_review_rule` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_homework`
--

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

--
-- Table structure for table `t_homework_review_rule`
--

DROP TABLE IF EXISTS `t_homework_review_rule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_homework_review_rule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `criteria` json NOT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `t_homework_review_rule_tenant_id_idx` (`tenant_id`),
  KEY `t_homework_review_rule_creator_fkey` (`creator`),
  KEY `t_homework_review_rule_modifier_fkey` (`modifier`),
  CONSTRAINT `t_homework_review_rule_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_review_rule_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_review_rule_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_homework_review_rule`
--

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

--
-- Table structure for table `t_homework_score`
--

DROP TABLE IF EXISTS `t_homework_score`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_homework_score` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `submission_id` int NOT NULL,
  `reviewer_id` int NOT NULL,
  `dimension_scores` json NOT NULL,
  `total_score` decimal(10,2) NOT NULL,
  `comments` text COLLATE utf8mb4_unicode_ci,
  `score_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_homework_score_submission_id_reviewer_id_key` (`submission_id`,`reviewer_id`),
  KEY `t_homework_score_tenant_id_submission_id_idx` (`tenant_id`,`submission_id`),
  KEY `t_homework_score_reviewer_id_idx` (`reviewer_id`),
  KEY `t_homework_score_creator_fkey` (`creator`),
  KEY `t_homework_score_modifier_fkey` (`modifier`),
  CONSTRAINT `t_homework_score_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_score_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_score_reviewer_id_fkey` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `t_homework_score_submission_id_fkey` FOREIGN KEY (`submission_id`) REFERENCES `t_homework_submission` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_homework_score_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_homework_score`
--

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

--
-- Table structure for table `t_homework_submission`
--

DROP TABLE IF EXISTS `t_homework_submission`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_homework_submission` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `homework_id` int NOT NULL,
  `student_id` int NOT NULL,
  `work_no` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `work_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `work_description` text COLLATE utf8mb4_unicode_ci,
  `files` json DEFAULT NULL,
  `attachments` json DEFAULT NULL,
  `submit_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `total_score` decimal(10,2) DEFAULT NULL,
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  `valid_state` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `t_homework_submission_homework_id_student_id_key` (`homework_id`,`student_id`),
  KEY `t_homework_submission_tenant_id_homework_id_idx` (`tenant_id`,`homework_id`),
  KEY `t_homework_submission_student_id_idx` (`student_id`),
  KEY `t_homework_submission_status_idx` (`status`),
  KEY `t_homework_submission_creator_fkey` (`creator`),
  KEY `t_homework_submission_modifier_fkey` (`modifier`),
  CONSTRAINT `t_homework_submission_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_submission_homework_id_fkey` FOREIGN KEY (`homework_id`) REFERENCES `t_homework` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_homework_submission_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `t_homework_submission_student_id_fkey` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `t_homework_submission_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t_homework_submission`
--

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

--
-- Table structure for table `teachers`
--

DROP TABLE IF EXISTS `teachers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `teachers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `tenant_id` int NOT NULL,
  `department_id` int NOT NULL,
  `employee_no` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_card` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` int DEFAULT NULL,
  `birth_date` datetime(3) DEFAULT NULL,
  `hire_date` datetime(3) DEFAULT NULL,
  `subject` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `teachers_user_id_key` (`user_id`),
  UNIQUE KEY `teachers_tenant_id_employee_no_key` (`tenant_id`,`employee_no`),
  KEY `teachers_department_id_fkey` (`department_id`),
  KEY `teachers_creator_fkey` (`creator`),
  KEY `teachers_modifier_fkey` (`modifier`),
  CONSTRAINT `teachers_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `teachers_department_id_fkey` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `teachers_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `teachers_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `teachers_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `teachers`
--

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

--
-- Table structure for table `tenant_menus`
--

DROP TABLE IF EXISTS `tenant_menus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tenant_menus` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `menu_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tenant_menus_tenant_id_menu_id_key` (`tenant_id`,`menu_id`),
  KEY `tenant_menus_menu_id_fkey` (`menu_id`),
  CONSTRAINT `tenant_menus_menu_id_fkey` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tenant_menus_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tenant_menus`
--

LOCK TABLES `tenant_menus` WRITE;
/*!40000 ALTER TABLE `tenant_menus` DISABLE KEYS */;
INSERT INTO `tenant_menus` VALUES (1,1,1),(2,1,2),(5,1,3),(8,1,4),(9,1,12),(3,1,13),(6,1,14),(10,1,15),(12,1,16),(14,1,17),(16,1,18),(18,1,19),(20,1,20),(22,1,25),(4,1,26),(7,1,27),(11,1,28),(13,1,29),(15,1,30),(17,1,31),(19,1,32),(21,1,33),(23,2,1),(24,2,2),(29,2,5),(25,2,6),(30,2,7),(33,2,8),(35,2,9),(37,2,10),(38,2,11),(36,2,21),(26,2,22),(31,2,23),(34,2,24),(39,2,25),(27,2,26),(32,2,27),(40,2,34),(28,2,35);
/*!40000 ALTER TABLE `tenant_menus` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tenants`
--

DROP TABLE IF EXISTS `tenants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tenants` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `domain` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_super` int NOT NULL DEFAULT '0',
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tenants_code_key` (`code`),
  UNIQUE KEY `tenants_domain_key` (`domain`),
  KEY `tenants_creator_fkey` (`creator`),
  KEY `tenants_modifier_fkey` (`modifier`),
  CONSTRAINT `tenants_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tenants_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tenants`
--

LOCK TABLES `tenants` WRITE;
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
INSERT INTO `tenants` VALUES (1,'超级租户','super','super','系统超级租户，拥有所有权限',1,1,NULL,NULL,'2026-01-18 02:00:23.863','2026-01-18 02:00:23.863'),(2,'香港小学','school1',NULL,NULL,0,1,NULL,NULL,'2026-01-18 02:03:25.302','2026-01-18 02:03:25.302');
/*!40000 ALTER TABLE `tenants` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `user_roles`
--

DROP TABLE IF EXISTS `user_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_roles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_roles_user_id_role_id_key` (`user_id`,`role_id`),
  KEY `user_roles_role_id_fkey` (`role_id`),
  CONSTRAINT `user_roles_role_id_fkey` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_roles_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user_roles`
--

LOCK TABLES `user_roles` WRITE;
/*!40000 ALTER TABLE `user_roles` DISABLE KEYS */;
INSERT INTO `user_roles` VALUES (1,1,1),(2,2,2);
/*!40000 ALTER TABLE `user_roles` 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,
  `tenant_id` int NOT NULL,
  `username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nickname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `organization` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enabled',
  `valid_state` int NOT NULL DEFAULT '1',
  `creator` int DEFAULT NULL,
  `modifier` int DEFAULT NULL,
  `create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `modify_time` datetime(3) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_tenant_id_username_key` (`tenant_id`,`username`),
  UNIQUE KEY `users_tenant_id_email_key` (`tenant_id`,`email`),
  KEY `users_creator_fkey` (`creator`),
  KEY `users_modifier_fkey` (`modifier`),
  CONSTRAINT `users_creator_fkey` FOREIGN KEY (`creator`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `users_modifier_fkey` FOREIGN KEY (`modifier`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `users_tenant_id_fkey` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!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,1,'admin','$2b$10$yEs4YwTEZ9/uhTXFuvUbfu5bKkUmvvcfV3K7EtDukVYFo3BltjZya','超级管理员','admin@super.com',NULL,NULL,NULL,NULL,'enabled',1,NULL,NULL,'2026-01-18 02:00:23.921','2026-01-18 02:00:40.895'),(2,2,'admin','$2b$10$7ppuHA7QhrqaBctS2C6Q2.GNvZtU3glDcLMUNFIY3NNYAqKCztLu6','管理员',NULL,NULL,NULL,NULL,NULL,'enabled',1,NULL,NULL,'2026-01-18 02:03:25.756','2026-01-18 02:03:25.756');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!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 2026-01-18 11:19:37
