· 7 years ago · Oct 17, 2018, 10:48 AM
1-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
2--
3-- Host: localhost Database: shop
4-- ------------------------------------------------------
5-- Server version 8.0.3-rc-log
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 `orders`
20--
21
22DROP TABLE IF EXISTS `orders`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `orders` (
26 `order_id` int(11) DEFAULT NULL,
27 `purchase_price` decimal(10,0) DEFAULT NULL,
28 `product_id` int(11) DEFAULT NULL,
29 `count` int(11) DEFAULT NULL,
30 `creation_date` date DEFAULT NULL,
31 KEY `order_id_idx` (`order_id`),
32 KEY `product_id_idx` (`product_id`),
33 CONSTRAINT `order_id` FOREIGN KEY (`order_id`) REFERENCES `orders_info` (`order_id`) ON DELETE CASCADE ON UPDATE CASCADE,
34 CONSTRAINT `product_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`product_id`)
35) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
36/*!40101 SET character_set_client = @saved_cs_client */;
37
38--
39-- Dumping data for table `orders`
40--
41
42LOCK TABLES `orders` WRITE;
43/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
44INSERT INTO `orders` VALUES (1,2000,1,1,NULL),(1,33000,2,1,NULL);
45/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
46UNLOCK TABLES;
47
48--
49-- Table structure for table `orders_info`
50--
51
52DROP TABLE IF EXISTS `orders_info`;
53/*!40101 SET @saved_cs_client = @@character_set_client */;
54/*!40101 SET character_set_client = utf8 */;
55CREATE TABLE `orders_info` (
56 `order_id` int(11) NOT NULL AUTO_INCREMENT,
57 `client_id` int(11) DEFAULT NULL,
58 `status` varchar(20) COLLATE utf8_bin DEFAULT NULL,
59 `changed_by` text COLLATE utf8_bin,
60 PRIMARY KEY (`order_id`),
61 KEY `user_id_idx` (`client_id`),
62 CONSTRAINT `client_id` FOREIGN KEY (`client_id`) REFERENCES `users` (`user_id`) ON UPDATE CASCADE
63) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
64/*!40101 SET character_set_client = @saved_cs_client */;
65
66--
67-- Dumping data for table `orders_info`
68--
69
70LOCK TABLES `orders_info` WRITE;
71/*!40000 ALTER TABLE `orders_info` DISABLE KEYS */;
72INSERT INTO `orders_info` VALUES (1,1,'completed','admin');
73/*!40000 ALTER TABLE `orders_info` ENABLE KEYS */;
74UNLOCK TABLES;
75
76--
77-- Table structure for table `products`
78--
79
80DROP TABLE IF EXISTS `products`;
81/*!40101 SET @saved_cs_client = @@character_set_client */;
82/*!40101 SET character_set_client = utf8 */;
83CREATE TABLE `products` (
84 `product_id` int(11) NOT NULL AUTO_INCREMENT,
85 `name` varchar(45) COLLATE utf8_bin DEFAULT NULL,
86 `description` text COLLATE utf8_bin,
87 `price` decimal(10,0) DEFAULT NULL,
88 `category` varchar(10) COLLATE utf8_bin DEFAULT NULL,
89 `path_to_photo` text COLLATE utf8_bin,
90 PRIMARY KEY (`product_id`)
91) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
92/*!40101 SET character_set_client = @saved_cs_client */;
93
94--
95-- Dumping data for table `products`
96--
97
98LOCK TABLES `products` WRITE;
99/*!40000 ALTER TABLE `products` DISABLE KEYS */;
100INSERT INTO `products` VALUES (1,'IPhone XS','New generation of phones',1299,'phone',''),(2,'IPad Mini','Tablet',300,'tablet',NULL),(3,'MacMini','Min computer',890,'desktop',NULL),(4,'IMac','Computer',1300,'desktop','C:\\Users\\Zver\\Desktop\\Pre_Prod_java_q3q4_2018\\Shop\\src\\main\\webapp\\shop\\images\\main-page-product-imac.jpg'),(5,'Test','Test',0,'tablet',NULL),(6,'t','t',4,'tablet',NULL),(7,'a','a',5,'phone',NULL),(8,'dsf','sdfs',6,'phone',NULL);
101/*!40000 ALTER TABLE `products` ENABLE KEYS */;
102UNLOCK TABLES;
103
104--
105-- Table structure for table `users`
106--
107
108DROP TABLE IF EXISTS `users`;
109/*!40101 SET @saved_cs_client = @@character_set_client */;
110/*!40101 SET character_set_client = utf8 */;
111CREATE TABLE `users` (
112 `user_id` int(11) NOT NULL AUTO_INCREMENT,
113 `first_name` varchar(45) DEFAULT NULL,
114 `second_name` varchar(45) DEFAULT NULL,
115 `username` varchar(45) DEFAULT NULL,
116 `password` varchar(45) DEFAULT NULL,
117 PRIMARY KEY (`user_id`)
118) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
119/*!40101 SET character_set_client = @saved_cs_client */;
120
121--
122-- Dumping data for table `users`
123--
124
125LOCK TABLES `users` WRITE;
126/*!40000 ALTER TABLE `users` DISABLE KEYS */;
127INSERT INTO `users` VALUES (1,'Oleg','Dlubovskyi','genevjov','root'),(2,'Test','Test','test','Test'),(3,'Valya','Bezumnaya','@bezumnaya','Bezumnaya&123'),(4,'imageTest','imageTest','imageTest','test'),(5,'Valya','Volohov','rwerwer','Qwerty&123'),(6,'sdf','sdfsdf','rwerwerq','Qwerty&123'),(7,'csdc','sdcsdcs','gerwefv','Qwerty&123'),(8,'qwerty','qwerty','qwwerty','Qwerty&123'),(9,'qweqwe','qweqweqw','qweqweqwe','Qwerty&123'),(10,'qwe','qwe','qaz','Qwerty&123'),(11,'qazxsw','qazxsw','qwertyui','Qwerty&123');
128/*!40000 ALTER TABLE `users` ENABLE KEYS */;
129UNLOCK TABLES;
130
131--
132-- Table structure for table `users_avatars`
133--
134
135DROP TABLE IF EXISTS `users_avatars`;
136/*!40101 SET @saved_cs_client = @@character_set_client */;
137/*!40101 SET character_set_client = utf8 */;
138CREATE TABLE `users_avatars` (
139 `user_id` int(11) DEFAULT NULL,
140 `path_to_avatar` longtext,
141 KEY `user_id_idx` (`user_id`),
142 CONSTRAINT `user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON UPDATE CASCADE
143) ENGINE=InnoDB DEFAULT CHARSET=utf8;
144/*!40101 SET character_set_client = @saved_cs_client */;
145
146--
147-- Dumping data for table `users_avatars`
148--
149
150LOCK TABLES `users_avatars` WRITE;
151/*!40000 ALTER TABLE `users_avatars` DISABLE KEYS */;
152INSERT INTO `users_avatars` VALUES (4,'test'),(5,'D8BA9039744A520F31B3F31B5F8DF034.png'),(6,'428537E96AD1E71EE7ED0737890ED69C.png'),(7,'1CC561D8B9110792933B67174FD18C76.png'),(8,'978137925D37433B684FC8BE18270C9C.png'),(9,'A7B9854C0EBC510951FFCB2DA998A449.png'),(10,'2659139A14CB49505EAD3949E8A101B6.png'),(11,'7AE3407CCD30061D0EA1CE791EA78993.png');
153/*!40000 ALTER TABLE `users_avatars` ENABLE KEYS */;
154UNLOCK TABLES;
155/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
156
157/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
158/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
159/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
160/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
161/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
162/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
163/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
164
165-- Dump completed on 2018-10-16 1:06:17