root | 59a69f8 | 2025-06-05 08:35:22 +0000 | [diff] [blame] | 1 | -- MySQL dump 10.13 Distrib 8.0.42, for Linux (x86_64) |
| 2 | -- |
| 3 | -- Host: localhost Database: pt_database_test |
| 4 | -- ------------------------------------------------------ |
| 5 | -- Server version 8.0.42-0ubuntu0.24.04.1 |
| 6 | |
| 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
| 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
| 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
| 10 | /*!50503 SET NAMES utf8mb4 */; |
| 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
| 12 | /*!40103 SET TIME_ZONE='+00:00' */; |
| 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; |
| 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
| 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; |
| 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; |
| 17 | |
| 18 | -- |
| 19 | -- Table structure for table `Announcement` |
| 20 | -- |
| 21 | |
| 22 | DROP TABLE IF EXISTS `Announcement`; |
| 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 24 | /*!50503 SET character_set_client = utf8mb4 */; |
| 25 | CREATE TABLE `Announcement` ( |
| 26 | `announce_id` varchar(64) NOT NULL, |
| 27 | `content` text NOT NULL, |
| 28 | `is_public` tinyint(1) NOT NULL DEFAULT '0', |
| 29 | `tag` varchar(100) DEFAULT NULL, |
| 30 | PRIMARY KEY (`announce_id`) |
| 31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 32 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 33 | |
| 34 | -- |
| 35 | -- Dumping data for table `Announcement` |
| 36 | -- |
| 37 | |
| 38 | LOCK TABLES `Announcement` WRITE; |
| 39 | /*!40000 ALTER TABLE `Announcement` DISABLE KEYS */; |
| 40 | INSERT INTO `Announcement` VALUES ('a1b2c3d4-e5f6-4711-89ab-cdef01234567','系统升级将在今晚 23:00 开始,预计持续 2 小时,期间可能无法访问。',1,'系统通知'),('a7b8c9d0-e1f2-4d77-ef01-23456789abcd','新增帮助中心文章:如何重置密码以及常见问题解答。',1,'帮助文档'),('b2c3d4e5-f6a7-4822-9abc-def012345678','新版本发布:增加了用户头像上传功能和消息提醒。',1,'产品更新'),('b8c9d0e1-f2a3-4e88-f012-3456789abcde','安全提醒:请尽快启用双因素认证,保障账户安全。',1,'安全提醒'),('c3d4e5f6-a7b8-4933-abcd-ef0123456789','本周末例行数据库维护,可能会短暂影响服务稳定性。',0,'运维公告'),('c9d0e1f2-a3b4-4f99-0123-456789abcdef','服务器证书将于 6 月 15 日过期,请相关负责人及时更新。',0,'运维公告'),('d0e1f2a3-b4c5-4a10-1234-56789abcdef0','本月员工生日会定于 5 月 30 日举办,地点:公司大会议室。',1,'公司活动'),('d4e5f6a7-b8c9-4a44-bcde-f0123456789a','节假日放假通知:5 月 1 日—5 月 3 日放假,共 3 天。',1,'节假日'),('e5f6a7b8-c9d0-4b55-cdef-0123456789ab','用户调查问卷已上线,欢迎参与并反馈使用感受。',1,'用户调研'),('f6a7b8c9-d0e1-4c66-def0-123456789abc','API 接口将于下周三变更,旧版接口将在 6 月底下线。',0,'开发者公告'); |
| 41 | /*!40000 ALTER TABLE `Announcement` ENABLE KEYS */; |
| 42 | UNLOCK TABLES; |
| 43 | |
| 44 | -- |
| 45 | -- Table structure for table `Appeal` |
| 46 | -- |
| 47 | |
| 48 | DROP TABLE IF EXISTS `Appeal`; |
| 49 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 50 | /*!50503 SET character_set_client = utf8mb4 */; |
| 51 | CREATE TABLE `Appeal` ( |
| 52 | `appeal_id` varchar(64) NOT NULL COMMENT '申诉ID', |
| 53 | `user_id` varchar(36) NOT NULL COMMENT '申诉人(User.user_id)', |
| 54 | `content` text NOT NULL COMMENT '申诉内容', |
| 55 | `file_url` varchar(255) DEFAULT NULL COMMENT '申诉文件URL', |
| 56 | `status` int NOT NULL DEFAULT '0' COMMENT '审核状态', |
| 57 | PRIMARY KEY (`appeal_id`), |
| 58 | KEY `fk_appeal_user` (`user_id`), |
| 59 | CONSTRAINT `fk_appeal_user` FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 60 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='申诉表,记录用户的申诉信息'; |
| 61 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 62 | |
| 63 | -- |
| 64 | -- Dumping data for table `Appeal` |
| 65 | -- |
| 66 | |
| 67 | LOCK TABLES `Appeal` WRITE; |
| 68 | /*!40000 ALTER TABLE `Appeal` DISABLE KEYS */; |
| 69 | INSERT INTO `Appeal` VALUES ('0307ad3c-09b5-40c0-8aa3-c5a8f0178f4c','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 9','http://example.com/file9',0),('202dd30a-3ee7-4d0f-a227-0a17325c9c68','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 8','http://example.com/file8',0),('212d0782-2ccb-4f25-876d-d4be990af7bc','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 6','http://example.com/file6',0),('4995a460-128e-4886-8682-e75bbb2dbce2','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 1','http://example.com/file1',0),('7b9c4044-39b6-41b5-8754-ff784788f116','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 2','http://example.com/file2',0),('a38fa86d-9bce-4342-852d-272566e46553','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 3','http://example.com/file3',0),('a6345f31-6938-4ff9-8c1e-0f5b3c9d6d56','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 5','http://example.com/file5',0),('b1c3fcdd-6c25-42d2-9782-cae4bd609368','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 0','http://example.com/file0',0),('bef4085a-1ec3-40ea-a43c-1964c9180e9d','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 7','http://example.com/file7',0),('ce843f31-eb01-4954-a234-d175d262bfdc','550e8400-e29b-41d4-a716-446655440000','GetAppealList test content 4','http://example.com/file4',0); |
| 70 | /*!40000 ALTER TABLE `Appeal` ENABLE KEYS */; |
| 71 | UNLOCK TABLES; |
| 72 | |
| 73 | -- |
| 74 | -- Table structure for table `BegSeed` |
| 75 | -- |
| 76 | |
| 77 | DROP TABLE IF EXISTS `BegSeed`; |
| 78 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 79 | /*!50503 SET character_set_client = utf8mb4 */; |
| 80 | CREATE TABLE `BegSeed` ( |
| 81 | `beg_id` varchar(64) NOT NULL, |
| 82 | `beg_count` int NOT NULL DEFAULT '0', |
| 83 | `reward_magic` int NOT NULL DEFAULT '0', |
| 84 | `deadline` datetime NOT NULL, |
| 85 | `has_match` tinyint(1) NOT NULL DEFAULT '0', |
| 86 | PRIMARY KEY (`beg_id`) |
| 87 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 88 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 89 | |
| 90 | -- |
| 91 | -- Dumping data for table `BegSeed` |
| 92 | -- |
| 93 | |
| 94 | LOCK TABLES `BegSeed` WRITE; |
| 95 | /*!40000 ALTER TABLE `BegSeed` DISABLE KEYS */; |
| 96 | INSERT INTO `BegSeed` VALUES ('test_beg_settle_1749112257693',1,100,'2025-05-21 08:30:58',1),('test_beg_settle_1749113033612',1,100,'2025-05-21 08:43:54',1),('test_beg_settle_1749115170790',1,100,'2025-05-21 09:19:31',1); |
| 97 | /*!40000 ALTER TABLE `BegSeed` ENABLE KEYS */; |
| 98 | UNLOCK TABLES; |
| 99 | |
| 100 | -- |
| 101 | -- Table structure for table `Post` |
| 102 | -- |
| 103 | |
| 104 | DROP TABLE IF EXISTS `Post`; |
| 105 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 106 | /*!50503 SET character_set_client = utf8mb4 */; |
| 107 | CREATE TABLE `Post` ( |
| 108 | `post_id` varchar(64) NOT NULL, |
| 109 | `title` varchar(255) NOT NULL, |
| 110 | `content` text NOT NULL, |
| 111 | `author_id` varchar(36) NOT NULL, |
| 112 | `created_at` datetime NOT NULL, |
| 113 | `reply_count` int NOT NULL DEFAULT '0', |
| 114 | `view_count` int NOT NULL DEFAULT '0', |
| 115 | PRIMARY KEY (`post_id`), |
| 116 | KEY `fk_post_user` (`author_id`), |
| 117 | CONSTRAINT `fk_post_user` FOREIGN KEY (`author_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 118 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 119 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 120 | |
| 121 | -- |
| 122 | -- Dumping data for table `Post` |
| 123 | -- |
| 124 | |
| 125 | LOCK TABLES `Post` WRITE; |
| 126 | /*!40000 ALTER TABLE `Post` DISABLE KEYS */; |
| 127 | /*!40000 ALTER TABLE `Post` ENABLE KEYS */; |
| 128 | UNLOCK TABLES; |
| 129 | |
| 130 | -- |
| 131 | -- Table structure for table `PostReply` |
| 132 | -- |
| 133 | |
| 134 | DROP TABLE IF EXISTS `PostReply`; |
| 135 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 136 | /*!50503 SET character_set_client = utf8mb4 */; |
| 137 | CREATE TABLE `PostReply` ( |
| 138 | `reply_id` varchar(64) NOT NULL, |
| 139 | `post_id` varchar(64) NOT NULL, |
| 140 | `content` text NOT NULL, |
| 141 | `author_id` varchar(36) NOT NULL, |
| 142 | `created_at` datetime NOT NULL, |
| 143 | PRIMARY KEY (`reply_id`), |
| 144 | KEY `fk_pr_post` (`post_id`), |
| 145 | KEY `fk_pr_user` (`author_id`), |
| 146 | CONSTRAINT `fk_pr_post` FOREIGN KEY (`post_id`) REFERENCES `Post` (`post_id`) ON DELETE CASCADE, |
| 147 | CONSTRAINT `fk_pr_user` FOREIGN KEY (`author_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 148 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 149 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 150 | |
| 151 | -- |
| 152 | -- Dumping data for table `PostReply` |
| 153 | -- |
| 154 | |
| 155 | LOCK TABLES `PostReply` WRITE; |
| 156 | /*!40000 ALTER TABLE `PostReply` DISABLE KEYS */; |
| 157 | /*!40000 ALTER TABLE `PostReply` ENABLE KEYS */; |
| 158 | UNLOCK TABLES; |
| 159 | |
| 160 | -- |
| 161 | -- Table structure for table `Seed` |
| 162 | -- |
| 163 | |
| 164 | DROP TABLE IF EXISTS `Seed`; |
| 165 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 166 | /*!50503 SET character_set_client = utf8mb4 */; |
| 167 | CREATE TABLE `Seed` ( |
| 168 | `seed_id` varchar(64) NOT NULL, |
| 169 | `owner_user_id` varchar(36) NOT NULL, |
| 170 | `fake_hits` int NOT NULL DEFAULT '0', |
| 171 | `last_fake_check` datetime DEFAULT NULL, |
| 172 | `external_url` varchar(255) DEFAULT NULL, |
| 173 | `title` varchar(255) NOT NULL, |
| 174 | `subtitle` varchar(255) DEFAULT NULL, |
| 175 | `size` varchar(50) NOT NULL, |
| 176 | `tags` varchar(255) DEFAULT NULL, |
| 177 | `popularity` int NOT NULL DEFAULT '0', |
| 178 | `URL` text COMMENT 'TTorrent 文件在服务器上存储的 URL', |
| 179 | PRIMARY KEY (`seed_id`), |
| 180 | KEY `fk_seed_user` (`owner_user_id`), |
| 181 | CONSTRAINT `fk_seed_user` FOREIGN KEY (`owner_user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 182 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 183 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 184 | |
| 185 | -- |
| 186 | -- Dumping data for table `Seed` |
| 187 | -- |
| 188 | |
| 189 | LOCK TABLES `Seed` WRITE; |
| 190 | /*!40000 ALTER TABLE `Seed` DISABLE KEYS */; |
| 191 | INSERT INTO `Seed` VALUES ('exampleSeedId','550e8400-e29b-41d4-a716-446655440000',0,NULL,NULL,'test',NULL,'1GB','大陆',0,'torrents/exampleSeedId_exampleSeedId_test16436511100052430070.torrent'),('seed001','550e8400-e29b-41d4-a716-446655440000',10,'2025-05-19 10:00:00','http://example.com/seed001','Awesome Movie','Action Thriller','1.5GB','大陆',100,'torrents/seed001_seed001_test17718681796068962628.torrent'),('seed004','550e8400-e29b-41d4-a716-446655440003',8,'2025-05-19 11:00:00','http://example.com/seed004','Comedy Series','Season 1','700MB','大陆',75,'torrents/seed004_seed004_test2953554280018110244.torrent'),('seed009','550e8400-e29b-41d4-a716-446655440008',18,'2025-05-17 21:45:00','http://example.com/seed009','Sci-Fi Movie','Space Odyssey','2GB','港台',180,'torrents/seed009_seed009_test13451296490325930642.torrent'),('seed111','550e8400-e29b-41d4-a716-446655440003',0,NULL,NULL,'test2',NULL,'1',NULL,0,'torrents/seed111_seed111_test14021531522609506819.torrent'),('seed222','550e8400-e29b-41d4-a716-446655440003',0,NULL,NULL,'test3',NULL,'1','港剧',0,'torrents/seed222_seed222_test11259979984170882790.torrent'),('test_seed_settle_1749111508968','550e8400-e29b-41d4-a716-446655440000',0,NULL,NULL,'测试种子',NULL,'1',NULL,0,'torrents/test_seed_settle_1749111508968_test_seed_settle_1749111508968_test14644621044707116370.torrent'),('test_seed_settle_1749111581741','550e8400-e29b-41d4-a716-446655440000',0,NULL,NULL,'测试种子',NULL,'1',NULL,0,'torrents/test_seed_settle_1749111581741_test_seed_settle_1749111581741_test4953741892853909459.torrent'),('test_seed_settle_1749112208219','550e8400-e29b-41d4-a716-446655440000',0,NULL,NULL,'测试种子',NULL,'1',NULL,0,'torrents/test_seed_settle_1749112208219_test_seed_settle_1749112208219_test3659044688757063978.torrent'),('test_seed_settle_1749112257695','550e8400-e29b-41d4-a716-446655440000',0,NULL,NULL,'测试种子',NULL,'1',NULL,0,'torrents/test_seed_settle_1749112257695_test_seed_settle_1749112257695_test17979750181307660047.torrent'),('test_seed_settle_1749113033614','550e8400-e29b-41d4-a716-446655440000',0,NULL,NULL,'测试种子',NULL,'1',NULL,0,'torrents/test_seed_settle_1749113033614_test_seed_settle_1749113033614_test13945890241269543288.torrent'),('test_seed_settle_1749115170791','550e8400-e29b-41d4-a716-446655440000',0,NULL,NULL,'测试种子',NULL,'1',NULL,0,NULL); |
| 192 | /*!40000 ALTER TABLE `Seed` ENABLE KEYS */; |
| 193 | UNLOCK TABLES; |
| 194 | |
| 195 | -- |
| 196 | -- Table structure for table `SeedDownload` |
| 197 | -- |
| 198 | |
| 199 | DROP TABLE IF EXISTS `SeedDownload`; |
| 200 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 201 | /*!50503 SET character_set_client = utf8mb4 */; |
| 202 | CREATE TABLE `SeedDownload` ( |
| 203 | `task_id` varchar(64) NOT NULL, |
| 204 | `user_id` varchar(36) NOT NULL, |
| 205 | `seed_id` varchar(64) NOT NULL, |
| 206 | `download_start` datetime NOT NULL, |
| 207 | `download_end` datetime DEFAULT NULL, |
| 208 | `is_dedicated` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0=普通,1=专线', |
| 209 | `client_ip` varchar(45) DEFAULT NULL, |
| 210 | PRIMARY KEY (`task_id`), |
| 211 | KEY `fk_sd_user` (`user_id`), |
| 212 | KEY `fk_sd_seed` (`seed_id`), |
| 213 | CONSTRAINT `fk_sd_seed` FOREIGN KEY (`seed_id`) REFERENCES `Seed` (`seed_id`) ON DELETE CASCADE, |
| 214 | CONSTRAINT `fk_sd_user` FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 215 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 216 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 217 | |
| 218 | -- |
| 219 | -- Dumping data for table `SeedDownload` |
| 220 | -- |
| 221 | |
| 222 | LOCK TABLES `SeedDownload` WRITE; |
| 223 | /*!40000 ALTER TABLE `SeedDownload` DISABLE KEYS */; |
| 224 | INSERT INTO `SeedDownload` VALUES ('3717648a-3ac0-11f0-b2ca-bc2411405807','550e8400-e29b-41d4-a716-446655440000','seed001','2025-05-01 09:12:34','2025-05-01 09:15:02',1,NULL),('3717762c-3ac0-11f0-b2ca-bc2411405807','550e8400-e29b-41d4-a716-446655440003','seed004','2025-05-04 07:30:10','2025-05-04 07:35:55',1,NULL),('3717806c-3ac0-11f0-b2ca-bc2411405807','550e8400-e29b-41d4-a716-446655440008','seed009','2025-05-09 05:05:05',NULL,0,NULL); |
| 225 | /*!40000 ALTER TABLE `SeedDownload` ENABLE KEYS */; |
| 226 | UNLOCK TABLES; |
| 227 | |
| 228 | -- |
| 229 | -- Table structure for table `SubmitSeed` |
| 230 | -- |
| 231 | |
| 232 | DROP TABLE IF EXISTS `SubmitSeed`; |
| 233 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 234 | /*!50503 SET character_set_client = utf8mb4 */; |
| 235 | CREATE TABLE `SubmitSeed` ( |
| 236 | `beg_id` varchar(64) NOT NULL, |
| 237 | `seed_id` varchar(64) NOT NULL, |
| 238 | `votes` int NOT NULL DEFAULT '0', |
| 239 | PRIMARY KEY (`beg_id`,`seed_id`), |
| 240 | KEY `fk_ss_seed` (`seed_id`), |
| 241 | CONSTRAINT `fk_ss_beg` FOREIGN KEY (`beg_id`) REFERENCES `BegSeed` (`beg_id`) ON DELETE CASCADE, |
| 242 | CONSTRAINT `fk_ss_seed` FOREIGN KEY (`seed_id`) REFERENCES `Seed` (`seed_id`) ON DELETE CASCADE |
| 243 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 244 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 245 | |
| 246 | -- |
| 247 | -- Dumping data for table `SubmitSeed` |
| 248 | -- |
| 249 | |
| 250 | LOCK TABLES `SubmitSeed` WRITE; |
| 251 | /*!40000 ALTER TABLE `SubmitSeed` DISABLE KEYS */; |
| 252 | INSERT INTO `SubmitSeed` VALUES ('test_beg_settle_1749112257693','test_seed_settle_1749112257695',1),('test_beg_settle_1749113033612','test_seed_settle_1749113033614',1),('test_beg_settle_1749115170790','test_seed_settle_1749115170791',1); |
| 253 | /*!40000 ALTER TABLE `SubmitSeed` ENABLE KEYS */; |
| 254 | UNLOCK TABLES; |
| 255 | |
| 256 | -- |
| 257 | -- Table structure for table `Transport` |
| 258 | -- |
| 259 | |
| 260 | DROP TABLE IF EXISTS `Transport`; |
| 261 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 262 | /*!50503 SET character_set_client = utf8mb4 */; |
| 263 | CREATE TABLE `Transport` ( |
| 264 | `task_id` varchar(64) NOT NULL, |
| 265 | `uploader_id` varchar(36) NOT NULL, |
| 266 | `downloader_id` varchar(36) NOT NULL, |
| 267 | `seed_id` varchar(64) NOT NULL, |
| 268 | `uploaded` bigint NOT NULL DEFAULT '0', |
| 269 | `downloaded` bigint NOT NULL DEFAULT '0', |
| 270 | `upload_peak` bigint NOT NULL DEFAULT '0', |
| 271 | `download_peak` bigint NOT NULL DEFAULT '0', |
| 272 | PRIMARY KEY (`task_id`,`uploader_id`,`downloader_id`), |
| 273 | KEY `fk_tr_user_up` (`uploader_id`), |
| 274 | KEY `fk_tr_user_down` (`downloader_id`), |
| 275 | KEY `fk_tr_seed` (`seed_id`), |
| 276 | CONSTRAINT `fk_tr_seed` FOREIGN KEY (`seed_id`) REFERENCES `Seed` (`seed_id`) ON DELETE CASCADE, |
| 277 | CONSTRAINT `fk_tr_user_down` FOREIGN KEY (`downloader_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE, |
| 278 | CONSTRAINT `fk_tr_user_up` FOREIGN KEY (`uploader_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 279 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 280 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 281 | |
| 282 | -- |
| 283 | -- Dumping data for table `Transport` |
| 284 | -- |
| 285 | |
| 286 | LOCK TABLES `Transport` WRITE; |
| 287 | /*!40000 ALTER TABLE `Transport` DISABLE KEYS */; |
| 288 | /*!40000 ALTER TABLE `Transport` ENABLE KEYS */; |
| 289 | UNLOCK TABLES; |
| 290 | |
| 291 | -- |
| 292 | -- Table structure for table `User` |
| 293 | -- |
| 294 | |
| 295 | DROP TABLE IF EXISTS `User`; |
| 296 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 297 | /*!50503 SET character_set_client = utf8mb4 */; |
| 298 | CREATE TABLE `User` ( |
| 299 | `user_id` varchar(36) NOT NULL, |
| 300 | `email` varchar(255) NOT NULL, |
| 301 | `username` varchar(100) NOT NULL, |
| 302 | `password` varchar(255) NOT NULL, |
| 303 | `gender` enum('m','f') NOT NULL, |
| 304 | `school` varchar(255) DEFAULT NULL, |
| 305 | `avatar_url` varchar(255) DEFAULT NULL, |
| 306 | `bio` text, |
| 307 | `account_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0=正常,1=被ban', |
| 308 | `invite_left` int NOT NULL DEFAULT '0', |
| 309 | `detectedCount` int NOT NULL DEFAULT '0', |
| 310 | `lastDetectedTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| 311 | `fake_detected_count` int NOT NULL DEFAULT '0', |
| 312 | `fake_last_detected_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| 313 | PRIMARY KEY (`user_id`,`email`), |
| 314 | UNIQUE KEY `uniq_email` (`email`) |
| 315 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 316 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 317 | |
| 318 | -- |
| 319 | -- Dumping data for table `User` |
| 320 | -- |
| 321 | |
| 322 | LOCK TABLES `User` WRITE; |
| 323 | /*!40000 ALTER TABLE `User` DISABLE KEYS */; |
| 324 | INSERT INTO `User` VALUES ('550e8400-e29b-41d4-a716-446655440000','alice@example.com','alice','$2y$10$abcdefghijklmnopqrstuv','f','Stanford University','https://cdn.example.com/avatars/alice.jpg','Passionate swimmer and coder.',0,5,0,'2025-05-20 12:29:40',0,'2025-05-27 09:37:46'),('550e8400-e29b-41d4-a716-446655440003','dave@example.net','dave','$2y$10$mnopqrstuvwxyzABCDEF','m','University of Oxford','https://cdn.example.com/avatars/dave.jpg','Guitarist in a jazz band.',0,0,0,'2025-05-20 12:29:40',0,'2025-05-27 09:37:46'),('550e8400-e29b-41d4-a716-446655440008','irene@example.org','irene','$2y$10$34567890abcdefghijklmn','f','National University of Singapore','https://cdn.example.com/avatars/irene.jpg','Time-lapse photographer and traveler.',0,0,0,'2025-05-20 12:29:40',0,'2025-05-27 09:37:46'); |
| 325 | /*!40000 ALTER TABLE `User` ENABLE KEYS */; |
| 326 | UNLOCK TABLES; |
| 327 | |
| 328 | -- |
| 329 | -- Table structure for table `UserFavorite` |
| 330 | -- |
| 331 | |
| 332 | DROP TABLE IF EXISTS `UserFavorite`; |
| 333 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 334 | /*!50503 SET character_set_client = utf8mb4 */; |
| 335 | CREATE TABLE `UserFavorite` ( |
| 336 | `user_id` varchar(36) NOT NULL, |
| 337 | `seed_id` varchar(64) NOT NULL, |
| 338 | PRIMARY KEY (`user_id`,`seed_id`), |
| 339 | UNIQUE KEY `UK_dqxat2yuess97ol62itck0bul` (`user_id`), |
| 340 | UNIQUE KEY `UK_kf5p3eu6m26b6afhmmfcbdn8j` (`seed_id`), |
| 341 | KEY `fk_uf_seed` (`seed_id`), |
| 342 | CONSTRAINT `fk_uf_seed` FOREIGN KEY (`seed_id`) REFERENCES `Seed` (`seed_id`) ON DELETE CASCADE, |
| 343 | CONSTRAINT `fk_uf_user` FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 344 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 345 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 346 | |
| 347 | -- |
| 348 | -- Dumping data for table `UserFavorite` |
| 349 | -- |
| 350 | |
| 351 | LOCK TABLES `UserFavorite` WRITE; |
| 352 | /*!40000 ALTER TABLE `UserFavorite` DISABLE KEYS */; |
| 353 | INSERT INTO `UserFavorite` VALUES ('550e8400-e29b-41d4-a716-446655440000','seed004'),('550e8400-e29b-41d4-a716-446655440003','seed009'),('550e8400-e29b-41d4-a716-446655440008','seed001'); |
| 354 | /*!40000 ALTER TABLE `UserFavorite` ENABLE KEYS */; |
| 355 | UNLOCK TABLES; |
| 356 | |
| 357 | -- |
| 358 | -- Table structure for table `UserInvite` |
| 359 | -- |
| 360 | |
| 361 | DROP TABLE IF EXISTS `UserInvite`; |
| 362 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 363 | /*!50503 SET character_set_client = utf8mb4 */; |
| 364 | CREATE TABLE `UserInvite` ( |
| 365 | `user_id` varchar(36) NOT NULL, |
| 366 | `inviter_email` varchar(255) NOT NULL, |
| 367 | `inviter_registered` tinyint(1) NOT NULL DEFAULT '0', |
| 368 | PRIMARY KEY (`user_id`,`inviter_email`), |
| 369 | CONSTRAINT `fk_ui_user` FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 370 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 371 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 372 | |
| 373 | -- |
| 374 | -- Dumping data for table `UserInvite` |
| 375 | -- |
| 376 | |
| 377 | LOCK TABLES `UserInvite` WRITE; |
| 378 | /*!40000 ALTER TABLE `UserInvite` DISABLE KEYS */; |
| 379 | INSERT INTO `UserInvite` VALUES ('550e8400-e29b-41d4-a716-446655440000','user009@example.com',1),('550e8400-e29b-41d4-a716-446655440003','user002@example.com',1),('550e8400-e29b-41d4-a716-446655440008','user007@example.com',1); |
| 380 | /*!40000 ALTER TABLE `UserInvite` ENABLE KEYS */; |
| 381 | UNLOCK TABLES; |
| 382 | |
| 383 | -- |
| 384 | -- Table structure for table `UserMigration` |
| 385 | -- |
| 386 | |
| 387 | DROP TABLE IF EXISTS `UserMigration`; |
| 388 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 389 | /*!50503 SET character_set_client = utf8mb4 */; |
| 390 | CREATE TABLE `UserMigration` ( |
| 391 | `migration_id` varchar(64) NOT NULL, |
| 392 | `user_id` varchar(36) NOT NULL, |
| 393 | `application_url` varchar(255) NOT NULL, |
| 394 | `approved` tinyint(1) NOT NULL DEFAULT '0', |
| 395 | `pending_magic` int NOT NULL DEFAULT '0', |
| 396 | `granted_magic` int NOT NULL DEFAULT '0', |
| 397 | `pending_uploaded` bigint NOT NULL DEFAULT '0', |
| 398 | `granted_uploaded` bigint NOT NULL DEFAULT '0', |
| 399 | PRIMARY KEY (`migration_id`), |
| 400 | KEY `fk_um_user` (`user_id`), |
| 401 | CONSTRAINT `fk_um_user` FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 402 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 403 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 404 | |
| 405 | -- |
| 406 | -- Dumping data for table `UserMigration` |
| 407 | -- |
| 408 | |
| 409 | LOCK TABLES `UserMigration` WRITE; |
| 410 | /*!40000 ALTER TABLE `UserMigration` DISABLE KEYS */; |
| 411 | /*!40000 ALTER TABLE `UserMigration` ENABLE KEYS */; |
| 412 | UNLOCK TABLES; |
| 413 | |
| 414 | -- |
| 415 | -- Table structure for table `UserPT` |
| 416 | -- |
| 417 | |
| 418 | DROP TABLE IF EXISTS `UserPT`; |
| 419 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 420 | /*!50503 SET character_set_client = utf8mb4 */; |
| 421 | CREATE TABLE `UserPT` ( |
| 422 | `user_id` varchar(36) NOT NULL, |
| 423 | `magic` int NOT NULL DEFAULT '0', |
| 424 | `uploaded` bigint NOT NULL DEFAULT '0', |
| 425 | `downloaded` bigint NOT NULL DEFAULT '0', |
| 426 | `ratio` decimal(5,2) NOT NULL DEFAULT '0.00', |
| 427 | `default_seed_path` varchar(255) DEFAULT NULL, |
| 428 | `vip_downloads` int NOT NULL DEFAULT '0', |
| 429 | PRIMARY KEY (`user_id`), |
| 430 | CONSTRAINT `fk_pt_user` FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE |
| 431 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 432 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 433 | |
| 434 | -- |
| 435 | -- Dumping data for table `UserPT` |
| 436 | -- |
| 437 | |
| 438 | LOCK TABLES `UserPT` WRITE; |
| 439 | /*!40000 ALTER TABLE `UserPT` DISABLE KEYS */; |
| 440 | INSERT INTO `UserPT` VALUES ('550e8400-e29b-41d4-a716-446655440000',0,0,0,0.00,'/data/seeds/550e8400-e29b-41d4-a716-446655440000',0),('550e8400-e29b-41d4-a716-446655440003',4096,4194304,2097152,2.00,'/data/seeds/550e8400-e29b-41d4-a716-446655440003',5),('550e8400-e29b-41d4-a716-446655440008',65536,65536000,32768000,2.00,'/data/seeds/550e8400-e29b-41d4-a716-446655440008',6); |
| 441 | /*!40000 ALTER TABLE `UserPT` ENABLE KEYS */; |
| 442 | UNLOCK TABLES; |
| 443 | |
| 444 | -- |
| 445 | -- Table structure for table `UserVotes` |
| 446 | -- |
| 447 | |
| 448 | DROP TABLE IF EXISTS `UserVotes`; |
| 449 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 450 | /*!50503 SET character_set_client = utf8mb4 */; |
| 451 | CREATE TABLE `UserVotes` ( |
| 452 | `user_id` varchar(36) NOT NULL, |
| 453 | `beg_id` varchar(64) NOT NULL, |
| 454 | `seed_id` varchar(64) NOT NULL, |
| 455 | `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| 456 | PRIMARY KEY (`user_id`,`beg_id`,`seed_id`), |
| 457 | KEY `beg_id` (`beg_id`), |
| 458 | KEY `seed_id` (`seed_id`), |
| 459 | CONSTRAINT `UserVotes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) ON DELETE CASCADE, |
| 460 | CONSTRAINT `UserVotes_ibfk_2` FOREIGN KEY (`beg_id`) REFERENCES `BegSeed` (`beg_id`) ON DELETE CASCADE, |
| 461 | CONSTRAINT `UserVotes_ibfk_3` FOREIGN KEY (`seed_id`) REFERENCES `Seed` (`seed_id`) ON DELETE CASCADE |
| 462 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 463 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 464 | |
| 465 | -- |
| 466 | -- Dumping data for table `UserVotes` |
| 467 | -- |
| 468 | |
| 469 | LOCK TABLES `UserVotes` WRITE; |
| 470 | /*!40000 ALTER TABLE `UserVotes` DISABLE KEYS */; |
| 471 | INSERT INTO `UserVotes` VALUES ('550e8400-e29b-41d4-a716-446655440000','test_beg_settle_1749112257693','test_seed_settle_1749112257695','2025-06-05 08:30:58'),('550e8400-e29b-41d4-a716-446655440000','test_beg_settle_1749113033612','test_seed_settle_1749113033614','2025-06-05 08:43:54'),('550e8400-e29b-41d4-a716-446655440000','test_beg_settle_1749115170790','test_seed_settle_1749115170791','2025-06-05 09:19:31'); |
| 472 | /*!40000 ALTER TABLE `UserVotes` ENABLE KEYS */; |
| 473 | UNLOCK TABLES; |
| 474 | |
| 475 | -- |
| 476 | -- Table structure for table `VipSeed` |
| 477 | -- |
| 478 | |
| 479 | DROP TABLE IF EXISTS `VipSeed`; |
| 480 | /*!40101 SET @saved_cs_client = @@character_set_client */; |
| 481 | /*!50503 SET character_set_client = utf8mb4 */; |
| 482 | CREATE TABLE `VipSeed` ( |
| 483 | `seed_id` varchar(64) NOT NULL, |
| 484 | `seeder_count` int NOT NULL DEFAULT '0', |
| 485 | `reward_magic` int NOT NULL DEFAULT '0', |
| 486 | `stop_caching` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0=继续缓存,1=不缓存', |
| 487 | `bonus` int NOT NULL, |
| 488 | `cache_status` bit(1) NOT NULL, |
| 489 | `farmer_number` int NOT NULL, |
| 490 | PRIMARY KEY (`seed_id`), |
| 491 | CONSTRAINT `fk_vip_seed` FOREIGN KEY (`seed_id`) REFERENCES `Seed` (`seed_id`) ON DELETE CASCADE |
| 492 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 493 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 494 | |
| 495 | -- |
| 496 | -- Dumping data for table `VipSeed` |
| 497 | -- |
| 498 | |
| 499 | LOCK TABLES `VipSeed` WRITE; |
| 500 | /*!40000 ALTER TABLE `VipSeed` DISABLE KEYS */; |
| 501 | INSERT INTO `VipSeed` VALUES ('seed001',5,50,0,10,_binary '',2),('seed004',8,80,0,15,_binary '',4),('seed009',30,300,0,60,_binary '\0',15); |
| 502 | /*!40000 ALTER TABLE `VipSeed` ENABLE KEYS */; |
| 503 | UNLOCK TABLES; |
| 504 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
| 505 | |
| 506 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
| 507 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
| 508 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; |
| 509 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
| 510 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
| 511 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
| 512 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
| 513 | |
| 514 | -- Dump completed on 2025-06-05 9:45:32 |