Pocet veci se seriakem
[mirrors/SokoMan.git] / install.sql
CommitLineData
41e57f9e 1-- MySQL dump 10.13 Distrib 5.1.49, for debian-linux-gnu (x86_64)
cdfce7c2
TM
2--
3-- Host: localhost Database: sklad
4-- ------------------------------------------------------
41e57f9e 5-- Server version 5.1.49-3
cdfce7c2
TM
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
22DROP TABLE IF EXISTS `category`;
41e57f9e
TM
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
cdfce7c2 25CREATE TABLE `category` (
41e57f9e
TM
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`),
cdfce7c2 29 UNIQUE KEY `category_name` (`category_name`)
3c5fedf3 30) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 31/*!40101 SET character_set_client = @saved_cs_client */;
cdfce7c2
TM
32
33--
34-- Dumping data for table `category`
35--
36
37LOCK TABLES `category` WRITE;
38/*!40000 ALTER TABLE `category` DISABLE KEYS */;
3c5fedf3 39INSERT 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 */;
41UNLOCK TABLES;
42
382324d3
TM
43--
44-- Table structure for table `group`
45--
46
47DROP TABLE IF EXISTS `group`;
41e57f9e
TM
48/*!40101 SET @saved_cs_client = @@character_set_client */;
49/*!40101 SET character_set_client = utf8 */;
382324d3 50CREATE TABLE `group` (
41e57f9e
TM
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`)
382324d3 55) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 56/*!40101 SET character_set_client = @saved_cs_client */;
382324d3
TM
57
58--
59-- Dumping data for table `group`
60--
61
62LOCK TABLES `group` WRITE;
63/*!40000 ALTER TABLE `group` DISABLE KEYS */;
64INSERT INTO `group` VALUES (0,'default','rw'),(0,'name','admin'),(2,'name','employee');
65/*!40000 ALTER TABLE `group` ENABLE KEYS */;
66UNLOCK TABLES;
67
928bb5a6
TM
68--
69-- Table structure for table `location`
70--
71
72DROP TABLE IF EXISTS `location`;
73/*!40101 SET @saved_cs_client = @@character_set_client */;
74/*!40101 SET character_set_client = utf8 */;
75CREATE TABLE `location` (
76 `location_id` int(11) NOT NULL AUTO_INCREMENT,
77 `location_name` varchar(23) COLLATE utf8_czech_ci NOT NULL,
78 `location_author` int(11) unsigned DEFAULT NULL,
79 `location_description` text COLLATE utf8_czech_ci,
80 PRIMARY KEY (`location_id`),
81 UNIQUE KEY `location_name` (`location_name`),
82 KEY `location_author` (`location_author`)
83) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
84/*!40101 SET character_set_client = @saved_cs_client */;
85
86--
87-- Dumping data for table `location`
88--
89
90LOCK TABLES `location` WRITE;
91/*!40000 ALTER TABLE `location` DISABLE KEYS */;
92INSERT INTO `location` VALUES (0,'UNIVERSE',14,'Tady je všechno co nikde neni :-)');
93/*!40000 ALTER TABLE `location` ENABLE KEYS */;
94UNLOCK TABLES;
95
cdfce7c2
TM
96--
97-- Table structure for table `producer`
98--
99
100DROP TABLE IF EXISTS `producer`;
41e57f9e
TM
101/*!40101 SET @saved_cs_client = @@character_set_client */;
102/*!40101 SET character_set_client = utf8 */;
cdfce7c2 103CREATE TABLE `producer` (
41e57f9e
TM
104 `producer_id` int(11) NOT NULL AUTO_INCREMENT,
105 `producer_name` varchar(64) COLLATE utf8_czech_ci NOT NULL,
106 `producer_note` varchar(512) COLLATE utf8_czech_ci NOT NULL,
107 PRIMARY KEY (`producer_id`),
cdfce7c2 108 UNIQUE KEY `producer_name` (`producer_name`)
0835e907 109) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 110/*!40101 SET character_set_client = @saved_cs_client */;
cdfce7c2
TM
111
112--
113-- Dumping data for table `producer`
114--
115
116LOCK TABLES `producer` WRITE;
117/*!40000 ALTER TABLE `producer` DISABLE KEYS */;
118INSERT INTO `producer` VALUES (1,'C.C.M.E','Czech Company Making Everything'),(2,'AchAchne Labz','Ach ne');
119/*!40000 ALTER TABLE `producer` ENABLE KEYS */;
120UNLOCK TABLES;
121
cdfce7c2
TM
122--
123-- Table structure for table `room`
124--
125
126DROP TABLE IF EXISTS `room`;
41e57f9e
TM
127/*!40101 SET @saved_cs_client = @@character_set_client */;
128/*!40101 SET character_set_client = utf8 */;
cdfce7c2 129CREATE TABLE `room` (
41e57f9e
TM
130 `room_id` int(11) NOT NULL AUTO_INCREMENT,
131 `room_name` varchar(64) COLLATE utf8_czech_ci NOT NULL,
132 `room_author` int(11) NOT NULL DEFAULT '0',
133 `room_descript` text COLLATE utf8_czech_ci NOT NULL,
134 PRIMARY KEY (`room_id`),
0835e907 135 UNIQUE KEY `room_name` (`room_name`),
326a9fc9 136 KEY `user_id` (`room_author`)
0835e907 137) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 138/*!40101 SET character_set_client = @saved_cs_client */;
cdfce7c2
TM
139
140--
141-- Dumping data for table `room`
142--
143
144LOCK TABLES `room` WRITE;
145/*!40000 ALTER TABLE `room` DISABLE KEYS */;
146INSERT INTO `room` VALUES (1,'BarvyLaky',0,'LakyBarvy');
147/*!40000 ALTER TABLE `room` ENABLE KEYS */;
148UNLOCK TABLES;
149
150--
151-- Table structure for table `status`
152--
153
154DROP TABLE IF EXISTS `status`;
41e57f9e
TM
155/*!40101 SET @saved_cs_client = @@character_set_client */;
156/*!40101 SET character_set_client = utf8 */;
cdfce7c2 157CREATE TABLE `status` (
41e57f9e
TM
158 `status_id` int(11) NOT NULL AUTO_INCREMENT,
159 `status_name` varchar(16) COLLATE utf8_czech_ci NOT NULL,
160 PRIMARY KEY (`status_id`),
cdfce7c2 161 UNIQUE KEY `status_name` (`status_name`)
41e57f9e
TM
162) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
163/*!40101 SET character_set_client = @saved_cs_client */;
cdfce7c2
TM
164
165--
166-- Dumping data for table `status`
167--
168
169LOCK TABLES `status` WRITE;
170/*!40000 ALTER TABLE `status` DISABLE KEYS */;
3b626989 171INSERT INTO `status` VALUES (0,'deleted'),(4,'destroyed'),(2,'placed'),(3,'sold'),(1,'stored');
cdfce7c2
TM
172/*!40000 ALTER TABLE `status` ENABLE KEYS */;
173UNLOCK TABLES;
174
0835e907
TM
175--
176-- Table structure for table `user`
177--
178
179DROP TABLE IF EXISTS `user`;
41e57f9e
TM
180/*!40101 SET @saved_cs_client = @@character_set_client */;
181/*!40101 SET character_set_client = utf8 */;
0835e907 182CREATE TABLE `user` (
41e57f9e
TM
183 `user_id` int(11) NOT NULL DEFAULT '0',
184 `user_permit` enum('user','admin') COLLATE utf8_czech_ci NOT NULL DEFAULT 'user',
185 PRIMARY KEY (`user_id`)
0835e907 186) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 187/*!40101 SET character_set_client = @saved_cs_client */;
0835e907
TM
188
189--
190-- Dumping data for table `user`
191--
192
193LOCK TABLES `user` WRITE;
194/*!40000 ALTER TABLE `user` DISABLE KEYS */;
195/*!40000 ALTER TABLE `user` ENABLE KEYS */;
196UNLOCK TABLES;
197
cdfce7c2
TM
198--
199-- Table structure for table `vendor`
200--
201
202DROP TABLE IF EXISTS `vendor`;
41e57f9e
TM
203/*!40101 SET @saved_cs_client = @@character_set_client */;
204/*!40101 SET character_set_client = utf8 */;
cdfce7c2 205CREATE TABLE `vendor` (
41e57f9e
TM
206 `vendor_id` int(11) NOT NULL AUTO_INCREMENT,
207 `vendor_name` varchar(64) COLLATE utf8_czech_ci NOT NULL,
208 `vendor_note` varchar(256) COLLATE utf8_czech_ci NOT NULL,
209 PRIMARY KEY (`vendor_id`),
cdfce7c2 210 UNIQUE KEY `vendor_name` (`vendor_name`)
0835e907 211) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 212/*!40101 SET character_set_client = @saved_cs_client */;
cdfce7c2
TM
213
214--
215-- Dumping data for table `vendor`
216--
217
218LOCK TABLES `vendor` WRITE;
219/*!40000 ALTER TABLE `vendor` DISABLE KEYS */;
220INSERT INTO `vendor` VALUES (1,'C.C.S.E','Czech Company Selling Everything'),(2,'Trolo Cybernetix','trololo');
221/*!40000 ALTER TABLE `vendor` ENABLE KEYS */;
222UNLOCK TABLES;
223/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
224
225/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
226/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
227/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
228/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
229/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
230/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
231/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
232
928bb5a6 233-- Dump completed on 2012-04-11 19:25:14
7f332543
TM
234
235/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
236/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
237/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
238/*!40101 SET NAMES utf8 */;
239/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
240/*!40103 SET TIME_ZONE='+00:00' */;
241/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
242/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
243/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
244/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
245DROP TABLE IF EXISTS `item`;
41e57f9e
TM
246/*!40101 SET @saved_cs_client = @@character_set_client */;
247/*!40101 SET character_set_client = utf8 */;
7f332543 248CREATE TABLE `item` (
41e57f9e 249 `item_id` int(11) NOT NULL AUTO_INCREMENT,
7f332543
TM
250 `model_id` int(11) NOT NULL,
251 `vendor_id` int(11) NOT NULL,
41e57f9e
TM
252 `item_serial` varchar(128) COLLATE utf8_czech_ci NOT NULL,
253 `item_quantity` int(11) NOT NULL DEFAULT '1',
254 `room_id` int(11) NOT NULL DEFAULT '1',
255 `status_id` int(11) NOT NULL DEFAULT '1',
256 `item_price_in` decimal(9,2) NOT NULL DEFAULT '0.00',
257 `item_price_out` decimal(9,2) DEFAULT NULL,
928bb5a6 258 `location_id` int(11) DEFAULT '0',
41e57f9e 259 `item_customer` int(11) DEFAULT NULL,
4ce8a610
TM
260 `item_date_bought` date NOT NULL DEFAULT '0000-00-00',
261 `item_date_sold` date DEFAULT '0000-00-00',
41e57f9e 262 `item_note` varchar(512) COLLATE utf8_czech_ci DEFAULT NULL,
7f332543 263 `item_author` int(11) NOT NULL,
41e57f9e
TM
264 `item_valid_till` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
265 `item_valid_from` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
266 PRIMARY KEY (`item_id`,`item_valid_till`),
7f332543
TM
267 UNIQUE KEY `item_serial_item_valid_till` (`item_serial`,`item_valid_till`),
268 KEY `vendor_id` (`vendor_id`),
269 KEY `model_id` (`model_id`),
270 KEY `status_id` (`status_id`),
271 KEY `room_id` (`room_id`),
928bb5a6
TM
272 KEY `location_id` (`location_id`),
273 CONSTRAINT `item_ibfk_10` FOREIGN KEY (`location_id`) REFERENCES `location` (`location_id`) ON DELETE SET NULL ON UPDATE CASCADE,
7f332543
TM
274 CONSTRAINT `item_ibfk_6` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`vendor_id`),
275 CONSTRAINT `item_ibfk_7` FOREIGN KEY (`model_id`) REFERENCES `model` (`model_id`),
276 CONSTRAINT `item_ibfk_8` FOREIGN KEY (`status_id`) REFERENCES `status` (`status_id`),
277 CONSTRAINT `item_ibfk_9` FOREIGN KEY (`room_id`) REFERENCES `room` (`room_id`)
4ce8a610 278) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 279/*!40101 SET character_set_client = @saved_cs_client */;
7f332543 280DROP TABLE IF EXISTS `model`;
41e57f9e
TM
281/*!40101 SET @saved_cs_client = @@character_set_client */;
282/*!40101 SET character_set_client = utf8 */;
7f332543 283CREATE TABLE `model` (
41e57f9e
TM
284 `model_id` int(11) NOT NULL AUTO_INCREMENT,
285 `model_name` varchar(64) COLLATE utf8_czech_ci NOT NULL,
286 `producer_id` int(11) NOT NULL DEFAULT '0',
287 `category_id` int(11) NOT NULL DEFAULT '0',
288 `model_barcode` varchar(128) COLLATE utf8_czech_ci NOT NULL,
289 `model_countable` int(1) NOT NULL DEFAULT '1',
290 `model_price_in` decimal(9,2) DEFAULT NULL,
291 `model_price_out` decimal(9,2) DEFAULT NULL,
292 `model_reserve` int(11) unsigned DEFAULT '0',
293 `model_eshop_hide` int(1) unsigned NOT NULL DEFAULT '0',
294 `model_descript` varchar(1024) COLLATE utf8_czech_ci NOT NULL,
295 PRIMARY KEY (`model_id`),
7f332543
TM
296 UNIQUE KEY `model_barcode` (`model_barcode`),
297 KEY `category_id` (`category_id`),
298 KEY `producer_id` (`producer_id`),
299 CONSTRAINT `model_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`),
300 CONSTRAINT `model_ibfk_2` FOREIGN KEY (`producer_id`) REFERENCES `producer` (`producer_id`)
4ce8a610 301) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
41e57f9e 302/*!40101 SET character_set_client = @saved_cs_client */;
7f332543
TM
303/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
304
305/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
306/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
307/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
308/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
309/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
310/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
311/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
312
This page took 0.333354 seconds and 4 git commands to generate.