HyeonJun Jeon

[Add] DB schema file

Showing 1 changed file with 163 additions and 0 deletions
1 +-- MySQL dump 10.14 Distrib 5.5.68-MariaDB, for Linux (x86_64)
2 +--
3 +-- Host: extended-calendar-db.cihyg6ssq3la.ap-northeast-2.rds.amazonaws.com Database: db
4 +-- ------------------------------------------------------
5 +-- Server version 8.0.28
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 +/*!40101 SET NAMES utf8 */;
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 `schedules_date`
20 +--
21 +
22 +DROP TABLE IF EXISTS `schedules_date`;
23 +/*!40101 SET @saved_cs_client = @@character_set_client */;
24 +/*!40101 SET character_set_client = utf8 */;
25 +CREATE TABLE `schedules_date` (
26 + `ID` int NOT NULL AUTO_INCREMENT,
27 + `userID` int NOT NULL,
28 + `uid` int DEFAULT NULL,
29 + `label` varchar(100) DEFAULT NULL,
30 + `subjectID` int NOT NULL,
31 + `type` varchar(50) DEFAULT NULL,
32 + `description` varchar(2000) DEFAULT NULL,
33 + `url` varchar(2000) DEFAULT NULL,
34 + `detail` varchar(4000) DEFAULT NULL,
35 + `status` tinyint DEFAULT '1',
36 + `date` date NOT NULL,
37 + PRIMARY KEY (`ID`),
38 + UNIQUE KEY `schedules_date(userID&uid)` (`userID`,`uid`),
39 + KEY `schedules_date-subjects` (`subjectID`),
40 + CONSTRAINT `schedules_date-subjects` FOREIGN KEY (`subjectID`) REFERENCES `subjects` (`ID`),
41 + CONSTRAINT `schedules_date-users` FOREIGN KEY (`userID`) REFERENCES `users` (`ID`)
42 +) ENGINE=InnoDB AUTO_INCREMENT=2587 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
43 +/*!40101 SET character_set_client = @saved_cs_client */;
44 +
45 +--
46 +-- Table structure for table `schedules_repeat`
47 +--
48 +
49 +DROP TABLE IF EXISTS `schedules_repeat`;
50 +/*!40101 SET @saved_cs_client = @@character_set_client */;
51 +/*!40101 SET character_set_client = utf8 */;
52 +CREATE TABLE `schedules_repeat` (
53 + `ID` int NOT NULL AUTO_INCREMENT,
54 + `userID` int NOT NULL,
55 + `uid` int DEFAULT NULL,
56 + `label` varchar(100) DEFAULT NULL,
57 + `subjectID` int NOT NULL,
58 + `type` varchar(50) DEFAULT NULL,
59 + `description` varchar(2000) DEFAULT NULL,
60 + `url` varchar(2000) DEFAULT NULL,
61 + `detail` varchar(4000) DEFAULT NULL,
62 + `status` tinyint DEFAULT '1',
63 + `day` tinyint DEFAULT NULL,
64 + `startTime` time DEFAULT NULL,
65 + `endTime` time DEFAULT NULL,
66 + PRIMARY KEY (`ID`),
67 + UNIQUE KEY `schedules_repeat(userID&uid)` (`userID`,`uid`),
68 + KEY `schedules_repeat-subjects` (`subjectID`),
69 + CONSTRAINT `schedules_repeat-subjects` FOREIGN KEY (`subjectID`) REFERENCES `subjects` (`ID`),
70 + CONSTRAINT `schedules_repeat-users` FOREIGN KEY (`userID`) REFERENCES `users` (`ID`)
71 +) ENGINE=InnoDB AUTO_INCREMENT=656 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
72 +/*!40101 SET character_set_client = @saved_cs_client */;
73 +
74 +--
75 +-- Table structure for table `schedules_time`
76 +--
77 +
78 +DROP TABLE IF EXISTS `schedules_time`;
79 +/*!40101 SET @saved_cs_client = @@character_set_client */;
80 +/*!40101 SET character_set_client = utf8 */;
81 +CREATE TABLE `schedules_time` (
82 + `ID` int NOT NULL AUTO_INCREMENT,
83 + `userID` int NOT NULL,
84 + `uid` int DEFAULT NULL,
85 + `label` varchar(100) DEFAULT NULL,
86 + `subjectID` int NOT NULL,
87 + `type` varchar(50) DEFAULT NULL,
88 + `description` varchar(2000) DEFAULT NULL,
89 + `url` varchar(2000) DEFAULT NULL,
90 + `detail` varchar(4000) DEFAULT NULL,
91 + `status` tinyint DEFAULT '1',
92 + `date` date NOT NULL,
93 + `startTime` time DEFAULT NULL,
94 + `endTime` time DEFAULT NULL,
95 + PRIMARY KEY (`ID`),
96 + UNIQUE KEY `schedules_time(userID&uid)` (`userID`,`uid`),
97 + KEY `schedules_time-subjects` (`subjectID`),
98 + CONSTRAINT `schedules_time-subjects` FOREIGN KEY (`subjectID`) REFERENCES `subjects` (`ID`),
99 + CONSTRAINT `schedules_time-users` FOREIGN KEY (`userID`) REFERENCES `users` (`ID`)
100 +) ENGINE=InnoDB AUTO_INCREMENT=1831 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
101 +/*!40101 SET character_set_client = @saved_cs_client */;
102 +
103 +--
104 +-- Table structure for table `subjects`
105 +--
106 +
107 +DROP TABLE IF EXISTS `subjects`;
108 +/*!40101 SET @saved_cs_client = @@character_set_client */;
109 +/*!40101 SET character_set_client = utf8 */;
110 +CREATE TABLE `subjects` (
111 + `ID` int NOT NULL,
112 + `name` text,
113 + PRIMARY KEY (`ID`)
114 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
115 +/*!40101 SET character_set_client = @saved_cs_client */;
116 +
117 +--
118 +-- Table structure for table `user-subject`
119 +--
120 +
121 +DROP TABLE IF EXISTS `user-subject`;
122 +/*!40101 SET @saved_cs_client = @@character_set_client */;
123 +/*!40101 SET character_set_client = utf8 */;
124 +CREATE TABLE `user-subject` (
125 + `userID` int DEFAULT NULL,
126 + `subjectID` int DEFAULT NULL,
127 + `nickname` varchar(255) DEFAULT NULL,
128 + `status` tinyint DEFAULT NULL,
129 + `color` char(6) DEFAULT NULL,
130 + UNIQUE KEY `uk` (`userID`,`subjectID`),
131 + KEY `subjectID` (`subjectID`),
132 + CONSTRAINT `user-subject_ibfk_1` FOREIGN KEY (`userID`) REFERENCES `users` (`ID`),
133 + CONSTRAINT `user-subject_ibfk_2` FOREIGN KEY (`subjectID`) REFERENCES `subjects` (`ID`)
134 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
135 +/*!40101 SET character_set_client = @saved_cs_client */;
136 +
137 +--
138 +-- Table structure for table `users`
139 +--
140 +
141 +DROP TABLE IF EXISTS `users`;
142 +/*!40101 SET @saved_cs_client = @@character_set_client */;
143 +/*!40101 SET character_set_client = utf8 */;
144 +CREATE TABLE `users` (
145 + `ID` int NOT NULL AUTO_INCREMENT,
146 + `name` varchar(40) DEFAULT NULL,
147 + `loginID` varchar(255) DEFAULT NULL,
148 + `loginPW` varchar(500) DEFAULT NULL,
149 + `ical` varchar(1000) DEFAULT NULL,
150 + PRIMARY KEY (`ID`)
151 +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
152 +/*!40101 SET character_set_client = @saved_cs_client */;
153 +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
154 +
155 +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
156 +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
157 +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
158 +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
159 +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
160 +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
161 +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
162 +
163 +-- Dump completed on 2022-06-10 8:28:06