Commit | Line | Data |
---|---|---|
cdfce7c2 TM |
1 | -- MySQL dump 10.11 |
2 | -- | |
3 | -- Host: localhost Database: sklad | |
4 | -- ------------------------------------------------------ | |
5 | -- Server version 5.0.51a-24+lenny5 | |
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 `category` | |
20 | -- | |
21 | ||
22 | DROP TABLE IF EXISTS `category`; | |
23 | SET @saved_cs_client = @@character_set_client; | |
24 | SET character_set_client = utf8; | |
25 | CREATE TABLE `category` ( | |
26 | `category_id` int(11) NOT NULL auto_increment, | |
27 | `category_name` varchar(64) collate utf8_czech_ci NOT NULL, | |
28 | PRIMARY KEY (`category_id`), | |
29 | UNIQUE KEY `category_name` (`category_name`) | |
3c5fedf3 | 30 | ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
cdfce7c2 TM |
31 | SET character_set_client = @saved_cs_client; |
32 | ||
33 | -- | |
34 | -- Dumping data for table `category` | |
35 | -- | |
36 | ||
37 | LOCK TABLES `category` WRITE; | |
38 | /*!40000 ALTER TABLE `category` DISABLE KEYS */; | |
3c5fedf3 | 39 | INSERT INTO `category` VALUES (3,'koren'),(8,'koren/a'),(10,'koren/a/a'),(11,'koren/a/c'),(9,'koren/a/d'),(12,'koren/a/o'),(13,'novy/x/y/z'),(1,'picovinky'),(2,'Tezka technika, Traktory, etc..'); |
cdfce7c2 TM |
40 | /*!40000 ALTER TABLE `category` ENABLE KEYS */; |
41 | UNLOCK TABLES; | |
42 | ||
382324d3 TM |
43 | -- |
44 | -- Table structure for table `group` | |
45 | -- | |
46 | ||
47 | DROP TABLE IF EXISTS `group`; | |
48 | SET @saved_cs_client = @@character_set_client; | |
49 | SET character_set_client = utf8; | |
50 | CREATE TABLE `group` ( | |
51 | `group_id` int(11) NOT NULL auto_increment, | |
52 | `group_key` char(23) collate utf8_czech_ci NOT NULL, | |
53 | `group_value` char(23) collate utf8_czech_ci NOT NULL, | |
54 | PRIMARY KEY (`group_id`,`group_key`) | |
55 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; | |
56 | SET character_set_client = @saved_cs_client; | |
57 | ||
58 | -- | |
59 | -- Dumping data for table `group` | |
60 | -- | |
61 | ||
62 | LOCK TABLES `group` WRITE; | |
63 | /*!40000 ALTER TABLE `group` DISABLE KEYS */; | |
64 | INSERT INTO `group` VALUES (0,'default','rw'),(0,'name','admin'),(2,'name','employee'); | |
65 | /*!40000 ALTER TABLE `group` ENABLE KEYS */; | |
66 | UNLOCK TABLES; | |
67 | ||
cdfce7c2 TM |
68 | -- |
69 | -- Table structure for table `producer` | |
70 | -- | |
71 | ||
72 | DROP TABLE IF EXISTS `producer`; | |
73 | SET @saved_cs_client = @@character_set_client; | |
74 | SET character_set_client = utf8; | |
75 | CREATE TABLE `producer` ( | |
76 | `producer_id` int(11) NOT NULL auto_increment, | |
77 | `producer_name` varchar(64) collate utf8_czech_ci NOT NULL, | |
78 | `producer_note` varchar(512) collate utf8_czech_ci NOT NULL, | |
79 | PRIMARY KEY (`producer_id`), | |
80 | UNIQUE KEY `producer_name` (`producer_name`) | |
0835e907 | 81 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
cdfce7c2 TM |
82 | SET character_set_client = @saved_cs_client; |
83 | ||
84 | -- | |
85 | -- Dumping data for table `producer` | |
86 | -- | |
87 | ||
88 | LOCK TABLES `producer` WRITE; | |
89 | /*!40000 ALTER TABLE `producer` DISABLE KEYS */; | |
90 | INSERT INTO `producer` VALUES (1,'C.C.M.E','Czech Company Making Everything'),(2,'AchAchne Labz','Ach ne'); | |
91 | /*!40000 ALTER TABLE `producer` ENABLE KEYS */; | |
92 | UNLOCK TABLES; | |
93 | ||
cdfce7c2 TM |
94 | -- |
95 | -- Table structure for table `room` | |
96 | -- | |
97 | ||
98 | DROP TABLE IF EXISTS `room`; | |
99 | SET @saved_cs_client = @@character_set_client; | |
100 | SET character_set_client = utf8; | |
101 | CREATE TABLE `room` ( | |
102 | `room_id` int(11) NOT NULL auto_increment, | |
103 | `room_name` varchar(64) collate utf8_czech_ci NOT NULL, | |
326a9fc9 | 104 | `room_author` int(11) NOT NULL default '0', |
cdfce7c2 TM |
105 | `room_descript` text collate utf8_czech_ci NOT NULL, |
106 | PRIMARY KEY (`room_id`), | |
0835e907 | 107 | UNIQUE KEY `room_name` (`room_name`), |
326a9fc9 | 108 | KEY `user_id` (`room_author`) |
0835e907 | 109 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
cdfce7c2 TM |
110 | SET character_set_client = @saved_cs_client; |
111 | ||
112 | -- | |
113 | -- Dumping data for table `room` | |
114 | -- | |
115 | ||
116 | LOCK TABLES `room` WRITE; | |
117 | /*!40000 ALTER TABLE `room` DISABLE KEYS */; | |
118 | INSERT INTO `room` VALUES (1,'BarvyLaky',0,'LakyBarvy'); | |
119 | /*!40000 ALTER TABLE `room` ENABLE KEYS */; | |
120 | UNLOCK TABLES; | |
121 | ||
122 | -- | |
123 | -- Table structure for table `status` | |
124 | -- | |
125 | ||
126 | DROP TABLE IF EXISTS `status`; | |
127 | SET @saved_cs_client = @@character_set_client; | |
128 | SET character_set_client = utf8; | |
129 | CREATE TABLE `status` ( | |
130 | `status_id` int(11) NOT NULL auto_increment, | |
131 | `status_name` varchar(16) collate utf8_czech_ci NOT NULL, | |
132 | PRIMARY KEY (`status_id`), | |
133 | UNIQUE KEY `status_name` (`status_name`) | |
b66fadbb | 134 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
cdfce7c2 TM |
135 | SET character_set_client = @saved_cs_client; |
136 | ||
137 | -- | |
138 | -- Dumping data for table `status` | |
139 | -- | |
140 | ||
141 | LOCK TABLES `status` WRITE; | |
142 | /*!40000 ALTER TABLE `status` DISABLE KEYS */; | |
bda4a4be | 143 | INSERT INTO `status` VALUES (0,'deleted'),(4,'destroyed'),(2,'placed'),(3,'saled'),(1,'stored'); |
cdfce7c2 TM |
144 | /*!40000 ALTER TABLE `status` ENABLE KEYS */; |
145 | UNLOCK TABLES; | |
146 | ||
0835e907 TM |
147 | -- |
148 | -- Table structure for table `user` | |
149 | -- | |
150 | ||
151 | DROP TABLE IF EXISTS `user`; | |
152 | SET @saved_cs_client = @@character_set_client; | |
153 | SET character_set_client = utf8; | |
154 | CREATE TABLE `user` ( | |
155 | `user_id` int(11) NOT NULL default '0', | |
156 | `user_permit` enum('user','admin') collate utf8_czech_ci NOT NULL default 'user', | |
b4dcae05 | 157 | PRIMARY KEY (`user_id`) |
0835e907 TM |
158 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
159 | SET character_set_client = @saved_cs_client; | |
160 | ||
161 | -- | |
162 | -- Dumping data for table `user` | |
163 | -- | |
164 | ||
165 | LOCK TABLES `user` WRITE; | |
166 | /*!40000 ALTER TABLE `user` DISABLE KEYS */; | |
167 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; | |
168 | UNLOCK TABLES; | |
169 | ||
cdfce7c2 TM |
170 | -- |
171 | -- Table structure for table `vendor` | |
172 | -- | |
173 | ||
174 | DROP TABLE IF EXISTS `vendor`; | |
175 | SET @saved_cs_client = @@character_set_client; | |
176 | SET character_set_client = utf8; | |
177 | CREATE TABLE `vendor` ( | |
178 | `vendor_id` int(11) NOT NULL auto_increment, | |
179 | `vendor_name` varchar(64) collate utf8_czech_ci NOT NULL, | |
180 | `vendor_note` varchar(256) collate utf8_czech_ci NOT NULL, | |
181 | PRIMARY KEY (`vendor_id`), | |
182 | UNIQUE KEY `vendor_name` (`vendor_name`) | |
0835e907 | 183 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
cdfce7c2 TM |
184 | SET character_set_client = @saved_cs_client; |
185 | ||
186 | -- | |
187 | -- Dumping data for table `vendor` | |
188 | -- | |
189 | ||
190 | LOCK TABLES `vendor` WRITE; | |
191 | /*!40000 ALTER TABLE `vendor` DISABLE KEYS */; | |
192 | INSERT INTO `vendor` VALUES (1,'C.C.S.E','Czech Company Selling Everything'),(2,'Trolo Cybernetix','trololo'); | |
193 | /*!40000 ALTER TABLE `vendor` ENABLE KEYS */; | |
194 | UNLOCK TABLES; | |
195 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | |
196 | ||
197 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | |
198 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | |
199 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | |
200 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | |
201 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | |
202 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | |
203 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | |
204 | ||
3c5fedf3 | 205 | -- Dump completed on 2011-11-22 14:52:26 |
7f332543 TM |
206 | |
207 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
208 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
209 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
210 | /*!40101 SET NAMES utf8 */; | |
211 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | |
212 | /*!40103 SET TIME_ZONE='+00:00' */; | |
213 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | |
214 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | |
215 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | |
216 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | |
217 | DROP TABLE IF EXISTS `item`; | |
218 | SET @saved_cs_client = @@character_set_client; | |
219 | SET character_set_client = utf8; | |
220 | CREATE TABLE `item` ( | |
221 | `item_id` int(11) NOT NULL auto_increment, | |
222 | `model_id` int(11) NOT NULL, | |
223 | `vendor_id` int(11) NOT NULL, | |
224 | `item_serial` varchar(128) collate utf8_czech_ci NOT NULL, | |
225 | `item_quantity` int(11) NOT NULL default '1', | |
226 | `room_id` int(11) NOT NULL default '1', | |
227 | `status_id` int(11) NOT NULL default '1', | |
228 | `item_price_in` decimal(9,2) NOT NULL default '0.00', | |
229 | `item_price_out` decimal(9,2) default NULL, | |
230 | `item_customer` int(11) default NULL, | |
231 | `item_note` varchar(512) collate utf8_czech_ci default NULL, | |
232 | `item_author` int(11) NOT NULL, | |
233 | `item_valid_till` timestamp NOT NULL default '0000-00-00 00:00:00', | |
234 | `item_valid_from` timestamp NULL default CURRENT_TIMESTAMP, | |
235 | PRIMARY KEY (`item_id`,`item_valid_till`), | |
236 | UNIQUE KEY `item_serial_item_valid_till` (`item_serial`,`item_valid_till`), | |
237 | KEY `vendor_id` (`vendor_id`), | |
238 | KEY `model_id` (`model_id`), | |
239 | KEY `status_id` (`status_id`), | |
240 | KEY `room_id` (`room_id`), | |
241 | CONSTRAINT `item_ibfk_6` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`vendor_id`), | |
242 | CONSTRAINT `item_ibfk_7` FOREIGN KEY (`model_id`) REFERENCES `model` (`model_id`), | |
243 | CONSTRAINT `item_ibfk_8` FOREIGN KEY (`status_id`) REFERENCES `status` (`status_id`), | |
244 | CONSTRAINT `item_ibfk_9` FOREIGN KEY (`room_id`) REFERENCES `room` (`room_id`) | |
245 | ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; | |
246 | SET character_set_client = @saved_cs_client; | |
247 | DROP TABLE IF EXISTS `model`; | |
248 | SET @saved_cs_client = @@character_set_client; | |
249 | SET character_set_client = utf8; | |
250 | CREATE TABLE `model` ( | |
251 | `model_id` int(11) NOT NULL auto_increment, | |
252 | `model_name` varchar(64) collate utf8_czech_ci NOT NULL, | |
253 | `producer_id` int(11) NOT NULL default '0', | |
254 | `category_id` int(11) NOT NULL default '0', | |
255 | `model_barcode` varchar(128) collate utf8_czech_ci NOT NULL, | |
256 | `model_countable` int(1) NOT NULL default '1', | |
257 | `model_price_in` decimal(9,2) default NULL, | |
258 | `model_price_out` decimal(9,2) default NULL, | |
3c5fedf3 | 259 | `model_reserve` int(11) unsigned default '0', |
7f332543 TM |
260 | `model_descript` varchar(1024) collate utf8_czech_ci NOT NULL, |
261 | PRIMARY KEY (`model_id`), | |
262 | UNIQUE KEY `model_barcode` (`model_barcode`), | |
263 | KEY `category_id` (`category_id`), | |
264 | KEY `producer_id` (`producer_id`), | |
265 | CONSTRAINT `model_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`), | |
266 | CONSTRAINT `model_ibfk_2` FOREIGN KEY (`producer_id`) REFERENCES `producer` (`producer_id`) | |
3c5fedf3 | 267 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
7f332543 TM |
268 | SET character_set_client = @saved_cs_client; |
269 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | |
270 | ||
271 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | |
272 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | |
273 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | |
274 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | |
275 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | |
276 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | |
277 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | |
278 |