· 8 years ago · Apr 12, 2018, 03:14 PM
1-- MySQL dump 10.13 Distrib 5.7.21, for Win64 (x86_64)
2--
3-- Host: localhost Database: store
4-- ------------------------------------------------------
5-- Server version 5.7.21-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 `item`
20--
21
22CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'meow1234';
23GRANT ALL PRIVILEGES ON store.* TO 'db_user'@'localhost';
24
25DROP TABLE IF EXISTS `item`;
26/*!40101 SET @saved_cs_client = @@character_set_client */;
27/*!40101 SET character_set_client = utf8 */;
28CREATE TABLE `item` (
29 `id` int(11) NOT NULL AUTO_INCREMENT,
30 `ITEM_NAME` varchar(30) NOT NULL,
31 `PRICE_PER_KG_IN_CENTS` int(11) DEFAULT NULL,
32 PRIMARY KEY (`id`)
33) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
34/*!40101 SET character_set_client = @saved_cs_client */;
35
36--
37-- Dumping data for table `item`
38--
39
40LOCK TABLES `item` WRITE;
41/*!40000 ALTER TABLE `item` DISABLE KEYS */;
42INSERT INTO `item` VALUES (1,'Bananas',150),(2,'Strawberries',99);
43/*!40000 ALTER TABLE `item` ENABLE KEYS */;
44UNLOCK TABLES;
45
46--
47-- Table structure for table `scales`
48--
49
50DROP TABLE IF EXISTS `scales`;
51/*!40101 SET @saved_cs_client = @@character_set_client */;
52/*!40101 SET character_set_client = utf8 */;
53CREATE TABLE `scales` (
54 `id` int(11) NOT NULL AUTO_INCREMENT,
55 `RFID_CODE` varchar(10) NOT NULL,
56 `SCALE_NAME` varchar(50) DEFAULT NULL,
57 PRIMARY KEY (`id`),
58 UNIQUE KEY `RFID_CODE_UNIQUE` (`RFID_CODE`)
59) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
60/*!40101 SET character_set_client = @saved_cs_client */;
61
62--
63-- Dumping data for table `scales`
64--
65
66LOCK TABLES `scales` WRITE;
67/*!40000 ALTER TABLE `scales` DISABLE KEYS */;
68INSERT INTO `scales` VALUES (1,'0102ac6f7b','Groceries Scale'),(2,'0345bd2b3d','Meat Scale');
69/*!40000 ALTER TABLE `scales` ENABLE KEYS */;
70UNLOCK TABLES;
71
72--
73-- Table structure for table `shopping_list`
74--
75
76DROP TABLE IF EXISTS `shopping_list`;
77/*!40101 SET @saved_cs_client = @@character_set_client */;
78/*!40101 SET character_set_client = utf8 */;
79CREATE TABLE `shopping_list` (
80 `id` int(11) NOT NULL AUTO_INCREMENT,
81 `CLIENT_ID` varchar(20) NOT NULL,
82 `TIME_OF_PURCHASE` datetime DEFAULT CURRENT_TIMESTAMP,
83 `SCALE_ID` varchar(10) DEFAULT NULL,
84 `IS_ARCHIVED` bit(1) DEFAULT NULL,
85 PRIMARY KEY (`id`),
86 KEY `SCALE_ID` (`SCALE_ID`),
87 CONSTRAINT `shopping_list_ibfk_1` FOREIGN KEY (`SCALE_ID`) REFERENCES `scales` (`RFID_CODE`)
88) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
89/*!40101 SET character_set_client = @saved_cs_client */;
90
91--
92-- Dumping data for table `shopping_list`
93--
94
95LOCK TABLES `shopping_list` WRITE;
96/*!40000 ALTER TABLE `shopping_list` DISABLE KEYS */;
97INSERT INTO `shopping_list` VALUES (9,'1','2018-03-17 13:06:16','0102ac6f7b',''),(10,'1','2018-03-17 13:06:30','0102ac6f7b',''),(11,'1','2018-03-17 13:09:49','0102ac6f7b','\0'),(12,'1','2018-03-17 13:11:53','0102ac6f7b','\0'),(13,'1','2018-03-17 13:12:47','0102ac6f7b','\0'),(14,'1','2018-03-17 13:31:34','0102ac6f7b','\0'),(15,'1','2018-03-17 13:39:51','0102ac6f7b','\0'),(16,'1','2018-03-17 13:39:59','0102ac6f7b','\0'),(17,'1','2018-03-17 13:40:12','0102ac6f7b',''),(18,'1','2018-03-23 00:07:26','0102ac6f7b',''),(19,'1','2018-03-23 00:14:44','0102ac6f7b',''),(20,'1','2018-03-23 00:23:41','0102ac6f7b','');
98/*!40000 ALTER TABLE `shopping_list` ENABLE KEYS */;
99UNLOCK TABLES;
100
101--
102-- Table structure for table `shopping_list_item`
103--
104
105DROP TABLE IF EXISTS `shopping_list_item`;
106/*!40101 SET @saved_cs_client = @@character_set_client */;
107/*!40101 SET character_set_client = utf8 */;
108CREATE TABLE `shopping_list_item` (
109 `id` int(11) NOT NULL AUTO_INCREMENT,
110 `SHOPPING_LIST_ID` int(11) DEFAULT NULL,
111 `ITEM_ID` int(11) DEFAULT NULL,
112 `WEIGHT_IN_GRAMS` int(11) DEFAULT NULL,
113 PRIMARY KEY (`id`),
114 KEY `SHOPPING_LIST_ID` (`SHOPPING_LIST_ID`),
115 KEY `ITEM_ID` (`ITEM_ID`),
116 CONSTRAINT `shopping_list_item_ibfk_1` FOREIGN KEY (`SHOPPING_LIST_ID`) REFERENCES `shopping_list` (`id`),
117 CONSTRAINT `shopping_list_item_ibfk_2` FOREIGN KEY (`ITEM_ID`) REFERENCES `item` (`id`)
118) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
119/*!40101 SET character_set_client = @saved_cs_client */;
120
121--
122-- Dumping data for table `shopping_list_item`
123--
124
125LOCK TABLES `shopping_list_item` WRITE;
126/*!40000 ALTER TABLE `shopping_list_item` DISABLE KEYS */;
127INSERT INTO `shopping_list_item` VALUES (2,9,1,200),(3,10,1,200),(4,10,1,200),(5,11,1,200),(6,14,1,200),(7,15,1,200);
128/*!40000 ALTER TABLE `shopping_list_item` ENABLE KEYS */;
129UNLOCK TABLES;
130/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
131
132/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
133/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
134/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
135/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
136/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
137/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
138/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
139
140-- Dump completed on 2018-04-08 1:14:46