· 4 years ago · Feb 11, 2021, 11:44 AM
1-- MySQL dump 10.13 Distrib 8.0.22, for macos10.15 (x86_64)
2--
3-- Host: localhost Database: ocpizzadb
4-- ------------------------------------------------------
5-- Server version 5.7.32
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 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 `address`
20--
21
22DROP TABLE IF EXISTS `address`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!50503 SET character_set_client = utf8mb4 */;
25CREATE TABLE `address` (
26 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
27 `additional` varchar(100) DEFAULT NULL,
28 `number` varchar(10) NOT NULL,
29 `street_name` varchar(45) NOT NULL,
30 `zip` varchar(5) NOT NULL,
31 `city` varchar(45) NOT NULL,
32 `observation` varchar(150) DEFAULT NULL,
33 PRIMARY KEY (`id`)
34) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
35/*!40101 SET character_set_client = @saved_cs_client */;
36
37--
38-- Dumping data for table `address`
39--
40
41LOCK TABLES `address` WRITE;
42/*!40000 ALTER TABLE `address` DISABLE KEYS */;
43INSERT INTO `address` VALUES (1,'Mas Roca','12','rue Lucie Bartre','66000','Perpignan',NULL);
44/*!40000 ALTER TABLE `address` ENABLE KEYS */;
45UNLOCK TABLES;
46
47--
48-- Table structure for table `commande_line`
49--
50
51DROP TABLE IF EXISTS `commande_line`;
52/*!40101 SET @saved_cs_client = @@character_set_client */;
53/*!50503 SET character_set_client = utf8mb4 */;
54CREATE TABLE `commande_line` (
55 `product_id` int(10) unsigned NOT NULL,
56 `order_order_number` int(10) unsigned NOT NULL,
57 `quantity` int(10) unsigned NOT NULL,
58 `price` double unsigned NOT NULL,
59 PRIMARY KEY (`product_id`,`order_order_number`),
60 KEY `fk_product_has_order_order1_idx` (`order_order_number`),
61 KEY `fk_product_has_order_product1_idx` (`product_id`),
62 CONSTRAINT `fk_product_has_order_order1` FOREIGN KEY (`order_order_number`) REFERENCES `order` (`order_number`) ON DELETE NO ACTION ON UPDATE NO ACTION,
63 CONSTRAINT `fk_product_has_order_product1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
64) ENGINE=InnoDB DEFAULT CHARSET=utf8;
65/*!40101 SET character_set_client = @saved_cs_client */;
66
67--
68-- Dumping data for table `commande_line`
69--
70
71LOCK TABLES `commande_line` WRITE;
72/*!40000 ALTER TABLE `commande_line` DISABLE KEYS */;
73/*!40000 ALTER TABLE `commande_line` ENABLE KEYS */;
74UNLOCK TABLES;
75
76--
77-- Table structure for table `customer`
78--
79
80DROP TABLE IF EXISTS `customer`;
81/*!40101 SET @saved_cs_client = @@character_set_client */;
82/*!50503 SET character_set_client = utf8mb4 */;
83CREATE TABLE `customer` (
84 `user_id` int(10) unsigned NOT NULL,
85 `favorite_payment_type` enum('Cash','Check','RestaurantTicket','CreditCard') DEFAULT NULL,
86 PRIMARY KEY (`user_id`),
87 CONSTRAINT `fk_customer_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
88) ENGINE=InnoDB DEFAULT CHARSET=utf8;
89/*!40101 SET character_set_client = @saved_cs_client */;
90
91--
92-- Dumping data for table `customer`
93--
94
95LOCK TABLES `customer` WRITE;
96/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
97INSERT INTO `customer` VALUES (1,'CreditCard');
98/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
99UNLOCK TABLES;
100
101--
102-- Table structure for table `employee`
103--
104
105DROP TABLE IF EXISTS `employee`;
106/*!40101 SET @saved_cs_client = @@character_set_client */;
107/*!50503 SET character_set_client = utf8mb4 */;
108CREATE TABLE `employee` (
109 `function` enum('Pizzaiolo','DeliveryMan','Manager','Director','Cashier') NOT NULL,
110 `user_id` int(10) unsigned NOT NULL,
111 PRIMARY KEY (`user_id`),
112 CONSTRAINT `fk_employee_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
113) ENGINE=InnoDB DEFAULT CHARSET=utf8;
114/*!40101 SET character_set_client = @saved_cs_client */;
115
116--
117-- Dumping data for table `employee`
118--
119
120LOCK TABLES `employee` WRITE;
121/*!40000 ALTER TABLE `employee` DISABLE KEYS */;
122/*!40000 ALTER TABLE `employee` ENABLE KEYS */;
123UNLOCK TABLES;
124
125--
126-- Table structure for table `invoice`
127--
128
129DROP TABLE IF EXISTS `invoice`;
130/*!40101 SET @saved_cs_client = @@character_set_client */;
131/*!50503 SET character_set_client = utf8mb4 */;
132CREATE TABLE `invoice` (
133 `number` int(10) unsigned NOT NULL AUTO_INCREMENT,
134 `date` date NOT NULL,
135 `payed` tinyint(4) NOT NULL,
136 `customer_user_id` int(10) unsigned NOT NULL,
137 PRIMARY KEY (`number`),
138 KEY `fk_invoice_customer1_idx` (`customer_user_id`),
139 CONSTRAINT `fk_invoice_customer1` FOREIGN KEY (`customer_user_id`) REFERENCES `customer` (`user_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
140) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
141/*!40101 SET character_set_client = @saved_cs_client */;
142
143--
144-- Dumping data for table `invoice`
145--
146
147LOCK TABLES `invoice` WRITE;
148/*!40000 ALTER TABLE `invoice` DISABLE KEYS */;
149INSERT INTO `invoice` VALUES (1,'2021-02-05',0,1);
150/*!40000 ALTER TABLE `invoice` ENABLE KEYS */;
151UNLOCK TABLES;
152
153--
154-- Table structure for table `order`
155--
156
157DROP TABLE IF EXISTS `order`;
158/*!40101 SET @saved_cs_client = @@character_set_client */;
159/*!50503 SET character_set_client = utf8mb4 */;
160CREATE TABLE `order` (
161 `order_number` int(10) unsigned NOT NULL AUTO_INCREMENT,
162 `status` enum('Pending','BeingPrepared','Prepared','InDelivering','Delivered','Completed') NOT NULL,
163 `date` datetime NOT NULL,
164 `invoice_number` int(10) unsigned NOT NULL,
165 `payment_id` int(10) unsigned NOT NULL,
166 `customer_user_id` int(10) unsigned NOT NULL,
167 PRIMARY KEY (`order_number`,`payment_id`),
168 KEY `fk_order_invoice1_idx` (`invoice_number`),
169 KEY `fk_order_payment1_idx` (`payment_id`),
170 KEY `fk_order_customer1_idx` (`customer_user_id`),
171 CONSTRAINT `fk_order_customer1` FOREIGN KEY (`customer_user_id`) REFERENCES `customer` (`user_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
172 CONSTRAINT `fk_order_invoice1` FOREIGN KEY (`invoice_number`) REFERENCES `invoice` (`number`) ON DELETE NO ACTION ON UPDATE NO ACTION,
173 CONSTRAINT `fk_order_payment1` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
174) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
175/*!40101 SET character_set_client = @saved_cs_client */;
176
177--
178-- Dumping data for table `order`
179--
180
181LOCK TABLES `order` WRITE;
182/*!40000 ALTER TABLE `order` DISABLE KEYS */;
183INSERT INTO `order` VALUES (1,'Prepared','2021-02-04 10:20:34',1,1,1);
184/*!40000 ALTER TABLE `order` ENABLE KEYS */;
185UNLOCK TABLES;
186
187--
188-- Table structure for table `payment`
189--
190
191DROP TABLE IF EXISTS `payment`;
192/*!40101 SET @saved_cs_client = @@character_set_client */;
193/*!50503 SET character_set_client = utf8mb4 */;
194CREATE TABLE `payment` (
195 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
196 `payment_type` enum('Cash','Check','RestaurantTicket','CreditCard') NOT NULL,
197 PRIMARY KEY (`id`)
198) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
199/*!40101 SET character_set_client = @saved_cs_client */;
200
201--
202-- Dumping data for table `payment`
203--
204
205LOCK TABLES `payment` WRITE;
206/*!40000 ALTER TABLE `payment` DISABLE KEYS */;
207INSERT INTO `payment` VALUES (1,'CreditCard');
208/*!40000 ALTER TABLE `payment` ENABLE KEYS */;
209UNLOCK TABLES;
210
211--
212-- Table structure for table `pizzeria`
213--
214
215DROP TABLE IF EXISTS `pizzeria`;
216/*!40101 SET @saved_cs_client = @@character_set_client */;
217/*!50503 SET character_set_client = utf8mb4 */;
218CREATE TABLE `pizzeria` (
219 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
220 `corporate_name` varchar(45) NOT NULL,
221 `phone_number` int(10) NOT NULL,
222 `is_open` tinyint(4) NOT NULL,
223 `email` varchar(255) NOT NULL,
224 `address_id` int(10) unsigned NOT NULL,
225 PRIMARY KEY (`id`,`address_id`),
226 KEY `fk_pizzeria_address1_idx` (`address_id`),
227 CONSTRAINT `fk_pizzeria_address1` FOREIGN KEY (`address_id`) REFERENCES `address` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
228) ENGINE=InnoDB DEFAULT CHARSET=utf8;
229/*!40101 SET character_set_client = @saved_cs_client */;
230
231--
232-- Dumping data for table `pizzeria`
233--
234
235LOCK TABLES `pizzeria` WRITE;
236/*!40000 ALTER TABLE `pizzeria` DISABLE KEYS */;
237/*!40000 ALTER TABLE `pizzeria` ENABLE KEYS */;
238UNLOCK TABLES;
239
240--
241-- Table structure for table `product`
242--
243
244DROP TABLE IF EXISTS `product`;
245/*!40101 SET @saved_cs_client = @@character_set_client */;
246/*!50503 SET character_set_client = utf8mb4 */;
247CREATE TABLE `product` (
248 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
249 `name` varchar(45) NOT NULL,
250 `quantity` int(11) NOT NULL,
251 `price` double NOT NULL,
252 `experition_date` date DEFAULT NULL,
253 `recipe` longtext,
254 `category` enum('Pizza','Drink','Dessert') NOT NULL,
255 PRIMARY KEY (`id`)
256) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
257/*!40101 SET character_set_client = @saved_cs_client */;
258
259--
260-- Dumping data for table `product`
261--
262
263LOCK TABLES `product` WRITE;
264/*!40000 ALTER TABLE `product` DISABLE KEYS */;
265INSERT INTO `product` VALUES (1,'Ortolana',5,7.99,NULL,'Ingredients\n\n1 batch of pizza dough\n400 ml – 13.5 oz. tomato purée\n2 tbsp extra virgin olive oil\n1 tbsp oregano\nSalt to taste\n350 gms – 12.5 oz. bocconcini or fresh mozzarella (half sliced and half shredded)\n2 red bell peppers roasted, skinned and sliced\n12 slices eggplant roasted\n7 artichoke hearts marinated in oil, quartered\nExtra virgin olive oil\nBasil\n\nInstructions\n\nMake the pizza dough as per this recipe and keep it to rise.\nWhile the dough rests, prepare the toppings: slice and shred the mozzarella.\nPrepare the tomato base by mixing the tomato purée with the extra virgin olive oil, oregano and salt to taste.\n\nWhen the pizza dough is ready, divide it in 4 smaller balls and roll them with a rolling pin into 4 circles approximately 0.5 cm – ¼ inch thick.\nNow spread the tomato base on the pizza and bake in a preheated fan forced oven at 180°C – 355°F for 15 minutes.\nTake them out of the oven and put the mozzarella, eggplant, bell peppers and artichoke hearts on the top. Put back in the oven for 5 minutes to let the cheese melt.\n\nWhen ready, take the pizze out of the oven and drizzle with some extra virgin olive oil.\nDecorate with fresh basil leaves, cut and enjoy warm!','Pizza');
266/*!40000 ALTER TABLE `product` ENABLE KEYS */;
267UNLOCK TABLES;
268
269--
270-- Table structure for table `stock`
271--
272
273DROP TABLE IF EXISTS `stock`;
274/*!40101 SET @saved_cs_client = @@character_set_client */;
275/*!50503 SET character_set_client = utf8mb4 */;
276CREATE TABLE `stock` (
277 `pizzeria_id` int(10) unsigned NOT NULL,
278 `product_id` int(10) unsigned NOT NULL,
279 `list` longtext,
280 PRIMARY KEY (`pizzeria_id`,`product_id`),
281 KEY `fk_pizzeria_has_product_product1_idx` (`product_id`),
282 KEY `fk_pizzeria_has_product_pizzeria1_idx` (`pizzeria_id`),
283 CONSTRAINT `fk_pizzeria_has_product_pizzeria1` FOREIGN KEY (`pizzeria_id`) REFERENCES `pizzeria` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
284 CONSTRAINT `fk_pizzeria_has_product_product1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
285) ENGINE=InnoDB DEFAULT CHARSET=utf8;
286/*!40101 SET character_set_client = @saved_cs_client */;
287
288--
289-- Dumping data for table `stock`
290--
291
292LOCK TABLES `stock` WRITE;
293/*!40000 ALTER TABLE `stock` DISABLE KEYS */;
294/*!40000 ALTER TABLE `stock` ENABLE KEYS */;
295UNLOCK TABLES;
296
297--
298-- Table structure for table `user`
299--
300
301DROP TABLE IF EXISTS `user`;
302/*!40101 SET @saved_cs_client = @@character_set_client */;
303/*!50503 SET character_set_client = utf8mb4 */;
304CREATE TABLE `user` (
305 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
306 `first_name` varchar(45) NOT NULL,
307 `last_name` varchar(45) NOT NULL,
308 `phone_number` int(10) unsigned NOT NULL,
309 `is_logged` tinyint(4) NOT NULL,
310 `email` varchar(255) NOT NULL,
311 `address_id` int(10) unsigned NOT NULL,
312 `username` varchar(45) NOT NULL,
313 `password` varchar(45) NOT NULL,
314 PRIMARY KEY (`id`,`address_id`),
315 KEY `fk_user_address1_idx` (`address_id`),
316 CONSTRAINT `fk_user_address1` FOREIGN KEY (`address_id`) REFERENCES `address` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
317) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
318/*!40101 SET character_set_client = @saved_cs_client */;
319
320--
321-- Dumping data for table `user`
322--
323
324LOCK TABLES `user` WRITE;
325/*!40000 ALTER TABLE `user` DISABLE KEYS */;
326INSERT INTO `user` VALUES (1,'Sebastien','Kothe',614722442,0,'sebastien.kothe@icloud.com',1,'sebastienkothe','OCperpignan66');
327/*!40000 ALTER TABLE `user` ENABLE KEYS */;
328UNLOCK TABLES;
329/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
330
331/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
332/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
333/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
334/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
335/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
336/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
337/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
338
339-- Dump completed on 2021-02-05 16:27:26
340