Zakladni podpora audit trails
[mirrors/SokoMan.git] / install.sql
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`)
30 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
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 */;
39 INSERT INTO `category` VALUES (1,'picovinky'),(2,'Tezka technika, Traktory, etc..');
40 /*!40000 ALTER TABLE `category` ENABLE KEYS */;
41 UNLOCK TABLES;
42
43 --
44 -- Table structure for table `item`
45 --
46
47 DROP TABLE IF EXISTS `item`;
48 SET @saved_cs_client = @@character_set_client;
49 SET character_set_client = utf8;
50 CREATE TABLE `item` (
51 `item_id` int(11) NOT NULL auto_increment,
52 `model_id` int(11) NOT NULL,
53 `vendor_id` int(11) NOT NULL,
54 `item_serial` varchar(128) collate utf8_czech_ci NOT NULL,
55 `item_quantity` int(11) default NULL,
56 `room_id` int(11) NOT NULL default '1',
57 `status_id` int(11) NOT NULL default '1',
58 `item_price_in` decimal(9,2) NOT NULL default '0.00',
59 `item_price_out` decimal(9,2) default NULL,
60 `user_id` int(11) NOT NULL,
61 `item_valid_from` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
62 `item_valid_till` timestamp NOT NULL default '0000-00-00 00:00:00',
63 PRIMARY KEY (`item_id`,`item_valid_till`),
64 UNIQUE KEY `item_serial` (`item_serial`),
65 KEY `vendor_id` (`vendor_id`),
66 KEY `model_id` (`model_id`),
67 KEY `status_id` (`status_id`),
68 KEY `room_id` (`room_id`),
69 CONSTRAINT `item_ibfk_6` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`vendor_id`),
70 CONSTRAINT `item_ibfk_7` FOREIGN KEY (`model_id`) REFERENCES `model` (`model_id`),
71 CONSTRAINT `item_ibfk_8` FOREIGN KEY (`status_id`) REFERENCES `status` (`status_id`),
72 CONSTRAINT `item_ibfk_9` FOREIGN KEY (`room_id`) REFERENCES `room` (`room_id`)
73 ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
74 SET character_set_client = @saved_cs_client;
75
76 --
77 -- Dumping data for table `item`
78 --
79
80 LOCK TABLES `item` WRITE;
81 /*!40000 ALTER TABLE `item` DISABLE KEYS */;
82 INSERT INTO `item` VALUES (9,3,2,'SATAN',0,1,1,'0.10','0.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(20,3,1,'editmeeeee',23,1,1,'0.00','0.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(22,1,1,'ahoj',42,1,1,'1.00','2.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(24,1,1,'',0,1,4,'0.00','0.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(25,1,1,'sdaNEW8',1,1,1,'0.00','0.00',23,'2011-08-05 04:14:17','0000-00-00 00:00:00'),(25,1,1,'sdaNEW',1,1,1,'0.00','0.00',0,'2011-08-05 03:20:15','2011-08-05 03:20:15'),(25,1,1,'sdaNEW4',1,1,1,'0.00','0.00',0,'2011-08-05 03:59:20','2011-08-05 03:59:20'),(25,1,1,'sdaNEW5',1,1,1,'0.00','0.00',0,'2011-08-05 04:00:30','2011-08-05 04:00:30'),(25,1,1,'sdaNEW2',1,1,1,'0.00','0.00',0,'2011-08-05 04:05:11','2011-08-05 04:05:11'),(25,1,1,'sdaNEW6',1,1,1,'0.00','0.00',0,'2011-08-05 04:06:04','2011-08-05 04:06:04'),(25,1,1,'sdaNEW7',1,1,1,'0.00','0.00',0,'2011-08-05 04:14:16','2011-08-05 04:14:16');
83 /*!40000 ALTER TABLE `item` ENABLE KEYS */;
84 UNLOCK TABLES;
85
86 --
87 -- Table structure for table `model`
88 --
89
90 DROP TABLE IF EXISTS `model`;
91 SET @saved_cs_client = @@character_set_client;
92 SET character_set_client = utf8;
93 CREATE TABLE `model` (
94 `model_id` int(11) NOT NULL auto_increment,
95 `model_name` varchar(64) collate utf8_czech_ci NOT NULL,
96 `producer_id` int(11) NOT NULL default '0',
97 `category_id` int(11) NOT NULL default '0',
98 `model_barcode` varchar(128) collate utf8_czech_ci NOT NULL,
99 `model_price_out` decimal(9,2) default NULL,
100 `model_descript` varchar(1024) collate utf8_czech_ci NOT NULL,
101 PRIMARY KEY (`model_id`),
102 UNIQUE KEY `model_barcode` (`model_barcode`),
103 KEY `category_id` (`category_id`),
104 KEY `producer_id` (`producer_id`),
105 CONSTRAINT `model_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`),
106 CONSTRAINT `model_ibfk_2` FOREIGN KEY (`producer_id`) REFERENCES `producer` (`producer_id`)
107 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
108 SET character_set_client = @saved_cs_client;
109
110 --
111 -- Dumping data for table `model`
112 --
113
114 LOCK TABLES `model` WRITE;
115 /*!40000 ALTER TABLE `model` DISABLE KEYS */;
116 INSERT INTO `model` VALUES (1,'Rushkoff: Klub extáze',1,1,'9788086096599','23.00','prvni vec s carovym kodem co sem videl'),(3,'Karel Gott - kompletní diskografie',2,2,'4792207502505','666.00','možno použít i k sebeobraně');
117 /*!40000 ALTER TABLE `model` ENABLE KEYS */;
118 UNLOCK TABLES;
119
120 --
121 -- Table structure for table `producer`
122 --
123
124 DROP TABLE IF EXISTS `producer`;
125 SET @saved_cs_client = @@character_set_client;
126 SET character_set_client = utf8;
127 CREATE TABLE `producer` (
128 `producer_id` int(11) NOT NULL auto_increment,
129 `producer_name` varchar(64) collate utf8_czech_ci NOT NULL,
130 `producer_note` varchar(512) collate utf8_czech_ci NOT NULL,
131 PRIMARY KEY (`producer_id`),
132 UNIQUE KEY `producer_name` (`producer_name`)
133 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
134 SET character_set_client = @saved_cs_client;
135
136 --
137 -- Dumping data for table `producer`
138 --
139
140 LOCK TABLES `producer` WRITE;
141 /*!40000 ALTER TABLE `producer` DISABLE KEYS */;
142 INSERT INTO `producer` VALUES (1,'C.C.M.E','Czech Company Making Everything'),(2,'AchAchne Labz','Ach ne');
143 /*!40000 ALTER TABLE `producer` ENABLE KEYS */;
144 UNLOCK TABLES;
145
146 --
147 -- Table structure for table `room`
148 --
149
150 DROP TABLE IF EXISTS `room`;
151 SET @saved_cs_client = @@character_set_client;
152 SET character_set_client = utf8;
153 CREATE TABLE `room` (
154 `room_id` int(11) NOT NULL auto_increment,
155 `room_name` varchar(64) collate utf8_czech_ci NOT NULL,
156 `user_id` int(11) NOT NULL default '0',
157 `room_descript` text collate utf8_czech_ci NOT NULL,
158 PRIMARY KEY (`room_id`),
159 UNIQUE KEY `room_name` (`room_name`),
160 KEY `user_id` (`user_id`)
161 ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
162 SET character_set_client = @saved_cs_client;
163
164 --
165 -- Dumping data for table `room`
166 --
167
168 LOCK TABLES `room` WRITE;
169 /*!40000 ALTER TABLE `room` DISABLE KEYS */;
170 INSERT INTO `room` VALUES (1,'BarvyLaky',0,'LakyBarvy');
171 /*!40000 ALTER TABLE `room` ENABLE KEYS */;
172 UNLOCK TABLES;
173
174 --
175 -- Table structure for table `status`
176 --
177
178 DROP TABLE IF EXISTS `status`;
179 SET @saved_cs_client = @@character_set_client;
180 SET character_set_client = utf8;
181 CREATE TABLE `status` (
182 `status_id` int(11) NOT NULL auto_increment,
183 `status_name` varchar(16) collate utf8_czech_ci NOT NULL,
184 PRIMARY KEY (`status_id`),
185 UNIQUE KEY `status_name` (`status_name`)
186 ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
187 SET character_set_client = @saved_cs_client;
188
189 --
190 -- Dumping data for table `status`
191 --
192
193 LOCK TABLES `status` WRITE;
194 /*!40000 ALTER TABLE `status` DISABLE KEYS */;
195 INSERT INTO `status` VALUES (5,'DELETED'),(4,'destroyed'),(2,'placed'),(3,'saled'),(1,'stored');
196 /*!40000 ALTER TABLE `status` ENABLE KEYS */;
197 UNLOCK TABLES;
198
199 --
200 -- Table structure for table `test_history`
201 --
202
203 DROP TABLE IF EXISTS `test_history`;
204 SET @saved_cs_client = @@character_set_client;
205 SET character_set_client = utf8;
206 CREATE TABLE `test_history` (
207 `id` int(11) NOT NULL auto_increment,
208 `data` char(23) collate utf8_czech_ci NOT NULL,
209 `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
210 `old` int(1) NOT NULL default '0',
211 PRIMARY KEY (`id`,`old`)
212 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
213 SET character_set_client = @saved_cs_client;
214
215 --
216 -- Dumping data for table `test_history`
217 --
218
219 LOCK TABLES `test_history` WRITE;
220 /*!40000 ALTER TABLE `test_history` DISABLE KEYS */;
221 INSERT INTO `test_history` VALUES (2,'lol','2011-08-04 01:19:43',0);
222 /*!40000 ALTER TABLE `test_history` ENABLE KEYS */;
223 UNLOCK TABLES;
224
225 --
226 -- Table structure for table `transaction`
227 --
228
229 DROP TABLE IF EXISTS `transaction`;
230 SET @saved_cs_client = @@character_set_client;
231 SET character_set_client = utf8;
232 CREATE TABLE `transaction` (
233 `transaction_id` int(11) NOT NULL auto_increment,
234 `item_id` int(11) NOT NULL default '0',
235 `transaction_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
236 `status_id_in` int(11) NOT NULL default '0',
237 `status_id_out` int(11) NOT NULL default '0',
238 `user_id` int(11) NOT NULL default '0',
239 PRIMARY KEY (`transaction_id`)
240 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
241 SET character_set_client = @saved_cs_client;
242
243 --
244 -- Dumping data for table `transaction`
245 --
246
247 LOCK TABLES `transaction` WRITE;
248 /*!40000 ALTER TABLE `transaction` DISABLE KEYS */;
249 /*!40000 ALTER TABLE `transaction` ENABLE KEYS */;
250 UNLOCK TABLES;
251
252 --
253 -- Table structure for table `user`
254 --
255
256 DROP TABLE IF EXISTS `user`;
257 SET @saved_cs_client = @@character_set_client;
258 SET character_set_client = utf8;
259 CREATE TABLE `user` (
260 `user_id` int(11) NOT NULL default '0',
261 `user_permit` enum('user','admin') collate utf8_czech_ci NOT NULL default 'user',
262 UNIQUE KEY `user_id` (`user_id`)
263 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
264 SET character_set_client = @saved_cs_client;
265
266 --
267 -- Dumping data for table `user`
268 --
269
270 LOCK TABLES `user` WRITE;
271 /*!40000 ALTER TABLE `user` DISABLE KEYS */;
272 /*!40000 ALTER TABLE `user` ENABLE KEYS */;
273 UNLOCK TABLES;
274
275 --
276 -- Table structure for table `vendor`
277 --
278
279 DROP TABLE IF EXISTS `vendor`;
280 SET @saved_cs_client = @@character_set_client;
281 SET character_set_client = utf8;
282 CREATE TABLE `vendor` (
283 `vendor_id` int(11) NOT NULL auto_increment,
284 `vendor_name` varchar(64) collate utf8_czech_ci NOT NULL,
285 `vendor_note` varchar(256) collate utf8_czech_ci NOT NULL,
286 PRIMARY KEY (`vendor_id`),
287 UNIQUE KEY `vendor_name` (`vendor_name`)
288 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
289 SET character_set_client = @saved_cs_client;
290
291 --
292 -- Dumping data for table `vendor`
293 --
294
295 LOCK TABLES `vendor` WRITE;
296 /*!40000 ALTER TABLE `vendor` DISABLE KEYS */;
297 INSERT INTO `vendor` VALUES (1,'C.C.S.E','Czech Company Selling Everything'),(2,'Trolo Cybernetix','trololo');
298 /*!40000 ALTER TABLE `vendor` ENABLE KEYS */;
299 UNLOCK TABLES;
300 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
301
302 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
303 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
304 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
305 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
306 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
307 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
308 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
309
310 -- Dump completed on 2011-08-05 4:24:16
This page took 0.388006 seconds and 5 git commands to generate.