· 6 years ago · Apr 01, 2019, 06:50 AM
1CREATE DATABASE IF NOT EXISTS `imhungry` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */;
2USE `imhungry`;
3-- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64)
4--
5-- Host: localhost Database: imhungry
6-- ------------------------------------------------------
7-- Server version 8.0.15
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12 SET NAMES utf8 ;
13/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14/*!40103 SET TIME_ZONE='+00:00' */;
15/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19
20--
21-- Table structure for table `recipe`
22--
23
24DROP TABLE IF EXISTS `recipe`;
25/*!40101 SET @saved_cs_client = @@character_set_client */;
26 SET character_set_client = utf8mb4 ;
27CREATE TABLE `recipe` (
28 `recipID` int(11) NOT NULL AUTO_INCREMENT,
29 `recipeIDapi` int(11) NOT NULL,
30 `prepTime` int(11) NOT NULL,
31 `cookTime` int(11) NOT NULL,
32 `ingredient` varchar(50) NOT NULL,
33 `instructions` varchar(50) NOT NULL,
34 `imageURL` varchar(50) NOT NULL,
35 PRIMARY KEY (`recipID`)
36) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
37/*!40101 SET character_set_client = @saved_cs_client */;
38
39--
40-- Dumping data for table `recipe`
41--
42
43LOCK TABLES `recipe` WRITE;
44/*!40000 ALTER TABLE `recipe` DISABLE KEYS */;
45/*!40000 ALTER TABLE `recipe` ENABLE KEYS */;
46UNLOCK TABLES;
47
48--
49-- Table structure for table `recipedonotshow`
50--
51
52DROP TABLE IF EXISTS `recipedonotshow`;
53/*!40101 SET @saved_cs_client = @@character_set_client */;
54 SET character_set_client = utf8mb4 ;
55CREATE TABLE `recipedonotshow` (
56 `favID` int(11) NOT NULL AUTO_INCREMENT,
57 `userID` int(11) NOT NULL,
58 `rID` int(11) NOT NULL,
59 PRIMARY KEY (`favID`),
60 KEY `fk7` (`userID`),
61 KEY `fk8` (`rID`),
62 CONSTRAINT `fk7` FOREIGN KEY (`userID`) REFERENCES `user` (`userID`),
63 CONSTRAINT `fk8` FOREIGN KEY (`rID`) REFERENCES `recipe` (`recipID`)
64) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
65/*!40101 SET character_set_client = @saved_cs_client */;
66
67--
68-- Dumping data for table `recipedonotshow`
69--
70
71LOCK TABLES `recipedonotshow` WRITE;
72/*!40000 ALTER TABLE `recipedonotshow` DISABLE KEYS */;
73/*!40000 ALTER TABLE `recipedonotshow` ENABLE KEYS */;
74UNLOCK TABLES;
75
76--
77-- Table structure for table `recipefavorites`
78--
79
80DROP TABLE IF EXISTS `recipefavorites`;
81/*!40101 SET @saved_cs_client = @@character_set_client */;
82 SET character_set_client = utf8mb4 ;
83CREATE TABLE `recipefavorites` (
84 `favID` int(11) NOT NULL AUTO_INCREMENT,
85 `userID` int(11) NOT NULL,
86 `rID` int(11) NOT NULL,
87 PRIMARY KEY (`favID`),
88 KEY `fk3` (`userID`),
89 KEY `fk4` (`rID`),
90 CONSTRAINT `fk3` FOREIGN KEY (`userID`) REFERENCES `user` (`userID`),
91 CONSTRAINT `fk4` FOREIGN KEY (`rID`) REFERENCES `recipe` (`recipID`)
92) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
93/*!40101 SET character_set_client = @saved_cs_client */;
94
95--
96-- Dumping data for table `recipefavorites`
97--
98
99LOCK TABLES `recipefavorites` WRITE;
100/*!40000 ALTER TABLE `recipefavorites` DISABLE KEYS */;
101/*!40000 ALTER TABLE `recipefavorites` ENABLE KEYS */;
102UNLOCK TABLES;
103
104--
105-- Table structure for table `recipetoexplore`
106--
107
108DROP TABLE IF EXISTS `recipetoexplore`;
109/*!40101 SET @saved_cs_client = @@character_set_client */;
110 SET character_set_client = utf8mb4 ;
111CREATE TABLE `recipetoexplore` (
112 `favID` int(11) NOT NULL AUTO_INCREMENT,
113 `userID` int(11) NOT NULL,
114 `rID` int(11) NOT NULL,
115 PRIMARY KEY (`favID`),
116 KEY `fk11` (`userID`),
117 KEY `fk12` (`rID`),
118 CONSTRAINT `fk11` FOREIGN KEY (`userID`) REFERENCES `user` (`userID`),
119 CONSTRAINT `fk12` FOREIGN KEY (`rID`) REFERENCES `recipe` (`recipID`)
120) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
121/*!40101 SET character_set_client = @saved_cs_client */;
122
123--
124-- Dumping data for table `recipetoexplore`
125--
126
127LOCK TABLES `recipetoexplore` WRITE;
128/*!40000 ALTER TABLE `recipetoexplore` DISABLE KEYS */;
129/*!40000 ALTER TABLE `recipetoexplore` ENABLE KEYS */;
130UNLOCK TABLES;
131
132--
133-- Table structure for table `restaurant`
134--
135
136DROP TABLE IF EXISTS `restaurant`;
137/*!40101 SET @saved_cs_client = @@character_set_client */;
138 SET character_set_client = utf8mb4 ;
139CREATE TABLE `restaurant` (
140 `restaurantID` int(11) NOT NULL AUTO_INCREMENT,
141 `rname` varchar(50) NOT NULL,
142 `address` varchar(50) NOT NULL,
143 `priceL` varchar(50) NOT NULL,
144 `driveTimeT` varchar(50) NOT NULL,
145 `driveTimeV` int(11) NOT NULL,
146 `phone` varchar(50) NOT NULL,
147 `url` varchar(50) NOT NULL,
148 PRIMARY KEY (`restaurantID`)
149) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
150/*!40101 SET character_set_client = @saved_cs_client */;
151
152--
153-- Dumping data for table `restaurant`
154--
155
156LOCK TABLES `restaurant` WRITE;
157/*!40000 ALTER TABLE `restaurant` DISABLE KEYS */;
158/*!40000 ALTER TABLE `restaurant` ENABLE KEYS */;
159UNLOCK TABLES;
160
161--
162-- Table structure for table `restdonotshow`
163--
164
165DROP TABLE IF EXISTS `restdonotshow`;
166/*!40101 SET @saved_cs_client = @@character_set_client */;
167 SET character_set_client = utf8mb4 ;
168CREATE TABLE `restdonotshow` (
169 `favID` int(11) NOT NULL AUTO_INCREMENT,
170 `userID` int(11) NOT NULL,
171 `rID` int(11) NOT NULL,
172 PRIMARY KEY (`favID`),
173 KEY `fk5` (`userID`),
174 KEY `fk6` (`rID`),
175 CONSTRAINT `fk5` FOREIGN KEY (`userID`) REFERENCES `user` (`userID`),
176 CONSTRAINT `fk6` FOREIGN KEY (`rID`) REFERENCES `restaurant` (`restaurantID`)
177) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
178/*!40101 SET character_set_client = @saved_cs_client */;
179
180--
181-- Dumping data for table `restdonotshow`
182--
183
184LOCK TABLES `restdonotshow` WRITE;
185/*!40000 ALTER TABLE `restdonotshow` DISABLE KEYS */;
186/*!40000 ALTER TABLE `restdonotshow` ENABLE KEYS */;
187UNLOCK TABLES;
188
189--
190-- Table structure for table `restfavorites`
191--
192
193DROP TABLE IF EXISTS `restfavorites`;
194/*!40101 SET @saved_cs_client = @@character_set_client */;
195 SET character_set_client = utf8mb4 ;
196CREATE TABLE `restfavorites` (
197 `favID` int(11) NOT NULL AUTO_INCREMENT,
198 `userID` int(11) NOT NULL,
199 `rID` int(11) NOT NULL,
200 PRIMARY KEY (`favID`),
201 KEY `fk1` (`userID`),
202 KEY `fk2` (`rID`),
203 CONSTRAINT `fk1` FOREIGN KEY (`userID`) REFERENCES `user` (`userID`),
204 CONSTRAINT `fk2` FOREIGN KEY (`rID`) REFERENCES `restaurant` (`restaurantID`)
205) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
206/*!40101 SET character_set_client = @saved_cs_client */;
207
208--
209-- Dumping data for table `restfavorites`
210--
211
212LOCK TABLES `restfavorites` WRITE;
213/*!40000 ALTER TABLE `restfavorites` DISABLE KEYS */;
214/*!40000 ALTER TABLE `restfavorites` ENABLE KEYS */;
215UNLOCK TABLES;
216
217--
218-- Table structure for table `resttoexplore`
219--
220
221DROP TABLE IF EXISTS `resttoexplore`;
222/*!40101 SET @saved_cs_client = @@character_set_client */;
223 SET character_set_client = utf8mb4 ;
224CREATE TABLE `resttoexplore` (
225 `favID` int(11) NOT NULL AUTO_INCREMENT,
226 `userID` int(11) NOT NULL,
227 `rID` int(11) NOT NULL,
228 PRIMARY KEY (`favID`),
229 KEY `fk9` (`userID`),
230 KEY `fk10` (`rID`),
231 CONSTRAINT `fk10` FOREIGN KEY (`rID`) REFERENCES `restaurant` (`restaurantID`),
232 CONSTRAINT `fk9` FOREIGN KEY (`userID`) REFERENCES `user` (`userID`)
233) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
234/*!40101 SET character_set_client = @saved_cs_client */;
235
236--
237-- Dumping data for table `resttoexplore`
238--
239
240LOCK TABLES `resttoexplore` WRITE;
241/*!40000 ALTER TABLE `resttoexplore` DISABLE KEYS */;
242/*!40000 ALTER TABLE `resttoexplore` ENABLE KEYS */;
243UNLOCK TABLES;
244
245--
246-- Table structure for table `user`
247--
248
249DROP TABLE IF EXISTS `user`;
250/*!40101 SET @saved_cs_client = @@character_set_client */;
251 SET character_set_client = utf8mb4 ;
252CREATE TABLE `user` (
253 `userID` int(11) NOT NULL AUTO_INCREMENT,
254 `username` varchar(50) NOT NULL,
255 `pw` varchar(50) NOT NULL,
256 `salt` varchar(50) NOT NULL,
257 PRIMARY KEY (`userID`)
258) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
259/*!40101 SET character_set_client = @saved_cs_client */;
260
261--
262-- Dumping data for table `user`
263--
264
265LOCK TABLES `user` WRITE;
266/*!40000 ALTER TABLE `user` DISABLE KEYS */;
267INSERT INTO `user` VALUES (1,'testuser','hashvalue','abcdefgh');
268/*!40000 ALTER TABLE `user` ENABLE KEYS */;
269UNLOCK TABLES;
270/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
271
272/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
273/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
274/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
275/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
276/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
277/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
278/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
279
280-- Dump completed on 2019-03-28 17:46:28