Opraveno razeni selectboxu, Bug s chybejicim user_name v tabulce useru uz neblokuje
[mirrors/SokoMan.git] / install.sql
CommitLineData
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
22DROP TABLE IF EXISTS `category`;
23SET @saved_cs_client = @@character_set_client;
24SET character_set_client = utf8;
25CREATE 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`)
0835e907 30) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
31SET character_set_client = @saved_cs_client;
32
33--
34-- Dumping data for table `category`
35--
36
37LOCK TABLES `category` WRITE;
38/*!40000 ALTER TABLE `category` DISABLE KEYS */;
39INSERT INTO `category` VALUES (1,'picovinky'),(2,'Tezka technika, Traktory, etc..');
40/*!40000 ALTER TABLE `category` ENABLE KEYS */;
41UNLOCK TABLES;
42
43--
44-- Table structure for table `item`
45--
46
47DROP TABLE IF EXISTS `item`;
48SET @saved_cs_client = @@character_set_client;
49SET character_set_client = utf8;
50CREATE 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 '0',
57 `status_id` int(11) NOT NULL default '0',
58 `item_price_in` decimal(9,2) NOT NULL default '0.00',
59 `item_price_out` decimal(9,2) default NULL,
60 PRIMARY KEY (`item_id`),
0835e907
TM
61 UNIQUE KEY `item_serial` (`item_serial`),
62 KEY `vendor_id` (`vendor_id`),
63 KEY `model_id` (`model_id`),
64 KEY `status_id` (`status_id`),
65 KEY `room_id` (`room_id`),
66 CONSTRAINT `item_ibfk_6` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`vendor_id`),
67 CONSTRAINT `item_ibfk_7` FOREIGN KEY (`model_id`) REFERENCES `model` (`model_id`),
68 CONSTRAINT `item_ibfk_8` FOREIGN KEY (`status_id`) REFERENCES `status` (`status_id`),
69 CONSTRAINT `item_ibfk_9` FOREIGN KEY (`room_id`) REFERENCES `room` (`room_id`)
70) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
71SET character_set_client = @saved_cs_client;
72
73--
74-- Dumping data for table `item`
75--
76
77LOCK TABLES `item` WRITE;
78/*!40000 ALTER TABLE `item` DISABLE KEYS */;
0835e907 79INSERT INTO `item` VALUES (9,3,2,'SATAN',0,1,1,'0.10','0.00'),(20,3,1,'editmeeeee',23,1,1,'0.00','0.00'),(22,1,1,'ahoj',42,1,1,'1.00','2.00');
cdfce7c2
TM
80/*!40000 ALTER TABLE `item` ENABLE KEYS */;
81UNLOCK TABLES;
82
83--
84-- Table structure for table `model`
85--
86
87DROP TABLE IF EXISTS `model`;
88SET @saved_cs_client = @@character_set_client;
89SET character_set_client = utf8;
90CREATE TABLE `model` (
91 `model_id` int(11) NOT NULL auto_increment,
92 `model_name` varchar(64) collate utf8_czech_ci NOT NULL,
93 `producer_id` int(11) NOT NULL default '0',
94 `category_id` int(11) NOT NULL default '0',
95 `model_barcode` varchar(128) collate utf8_czech_ci NOT NULL,
96 `model_price_out` decimal(9,2) default NULL,
97 `model_descript` varchar(1024) collate utf8_czech_ci NOT NULL,
98 PRIMARY KEY (`model_id`),
0835e907
TM
99 UNIQUE KEY `model_barcode` (`model_barcode`),
100 KEY `category_id` (`category_id`),
101 KEY `producer_id` (`producer_id`),
102 CONSTRAINT `model_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`),
103 CONSTRAINT `model_ibfk_2` FOREIGN KEY (`producer_id`) REFERENCES `producer` (`producer_id`)
104) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
105SET character_set_client = @saved_cs_client;
106
107--
108-- Dumping data for table `model`
109--
110
111LOCK TABLES `model` WRITE;
112/*!40000 ALTER TABLE `model` DISABLE KEYS */;
0835e907 113INSERT 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ě');
cdfce7c2
TM
114/*!40000 ALTER TABLE `model` ENABLE KEYS */;
115UNLOCK TABLES;
116
117--
118-- Table structure for table `producer`
119--
120
121DROP TABLE IF EXISTS `producer`;
122SET @saved_cs_client = @@character_set_client;
123SET character_set_client = utf8;
124CREATE TABLE `producer` (
125 `producer_id` int(11) NOT NULL auto_increment,
126 `producer_name` varchar(64) collate utf8_czech_ci NOT NULL,
127 `producer_note` varchar(512) collate utf8_czech_ci NOT NULL,
128 PRIMARY KEY (`producer_id`),
129 UNIQUE KEY `producer_name` (`producer_name`)
0835e907 130) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
131SET character_set_client = @saved_cs_client;
132
133--
134-- Dumping data for table `producer`
135--
136
137LOCK TABLES `producer` WRITE;
138/*!40000 ALTER TABLE `producer` DISABLE KEYS */;
139INSERT INTO `producer` VALUES (1,'C.C.M.E','Czech Company Making Everything'),(2,'AchAchne Labz','Ach ne');
140/*!40000 ALTER TABLE `producer` ENABLE KEYS */;
141UNLOCK TABLES;
142
cdfce7c2
TM
143--
144-- Table structure for table `room`
145--
146
147DROP TABLE IF EXISTS `room`;
148SET @saved_cs_client = @@character_set_client;
149SET character_set_client = utf8;
150CREATE TABLE `room` (
151 `room_id` int(11) NOT NULL auto_increment,
152 `room_name` varchar(64) collate utf8_czech_ci NOT NULL,
0835e907 153 `user_id` int(11) NOT NULL default '0',
cdfce7c2
TM
154 `room_descript` text collate utf8_czech_ci NOT NULL,
155 PRIMARY KEY (`room_id`),
0835e907
TM
156 UNIQUE KEY `room_name` (`room_name`),
157 KEY `user_id` (`user_id`)
158) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
159SET character_set_client = @saved_cs_client;
160
161--
162-- Dumping data for table `room`
163--
164
165LOCK TABLES `room` WRITE;
166/*!40000 ALTER TABLE `room` DISABLE KEYS */;
167INSERT INTO `room` VALUES (1,'BarvyLaky',0,'LakyBarvy');
168/*!40000 ALTER TABLE `room` ENABLE KEYS */;
169UNLOCK TABLES;
170
171--
172-- Table structure for table `status`
173--
174
175DROP TABLE IF EXISTS `status`;
176SET @saved_cs_client = @@character_set_client;
177SET character_set_client = utf8;
178CREATE TABLE `status` (
179 `status_id` int(11) NOT NULL auto_increment,
180 `status_name` varchar(16) collate utf8_czech_ci NOT NULL,
181 PRIMARY KEY (`status_id`),
182 UNIQUE KEY `status_name` (`status_name`)
0835e907 183) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
184SET character_set_client = @saved_cs_client;
185
186--
187-- Dumping data for table `status`
188--
189
190LOCK TABLES `status` WRITE;
191/*!40000 ALTER TABLE `status` DISABLE KEYS */;
0835e907 192INSERT INTO `status` VALUES (4,'destroyed'),(2,'placed'),(3,'saled'),(1,'stored');
cdfce7c2
TM
193/*!40000 ALTER TABLE `status` ENABLE KEYS */;
194UNLOCK TABLES;
195
196--
197-- Table structure for table `transaction`
198--
199
200DROP TABLE IF EXISTS `transaction`;
201SET @saved_cs_client = @@character_set_client;
202SET character_set_client = utf8;
203CREATE TABLE `transaction` (
204 `transaction_id` int(11) NOT NULL auto_increment,
205 `item_id` int(11) NOT NULL default '0',
206 `transaction_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
207 `status_id_in` int(11) NOT NULL default '0',
208 `status_id_out` int(11) NOT NULL default '0',
209 `user_id` int(11) NOT NULL default '0',
210 PRIMARY KEY (`transaction_id`)
0835e907 211) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
212SET character_set_client = @saved_cs_client;
213
214--
215-- Dumping data for table `transaction`
216--
217
218LOCK TABLES `transaction` WRITE;
219/*!40000 ALTER TABLE `transaction` DISABLE KEYS */;
220/*!40000 ALTER TABLE `transaction` ENABLE KEYS */;
221UNLOCK TABLES;
222
0835e907
TM
223--
224-- Table structure for table `user`
225--
226
227DROP TABLE IF EXISTS `user`;
228SET @saved_cs_client = @@character_set_client;
229SET character_set_client = utf8;
230CREATE TABLE `user` (
231 `user_id` int(11) NOT NULL default '0',
232 `user_permit` enum('user','admin') collate utf8_czech_ci NOT NULL default 'user',
233 UNIQUE KEY `user_id` (`user_id`)
234) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
235SET character_set_client = @saved_cs_client;
236
237--
238-- Dumping data for table `user`
239--
240
241LOCK TABLES `user` WRITE;
242/*!40000 ALTER TABLE `user` DISABLE KEYS */;
243/*!40000 ALTER TABLE `user` ENABLE KEYS */;
244UNLOCK TABLES;
245
cdfce7c2
TM
246--
247-- Table structure for table `vendor`
248--
249
250DROP TABLE IF EXISTS `vendor`;
251SET @saved_cs_client = @@character_set_client;
252SET character_set_client = utf8;
253CREATE TABLE `vendor` (
254 `vendor_id` int(11) NOT NULL auto_increment,
255 `vendor_name` varchar(64) collate utf8_czech_ci NOT NULL,
256 `vendor_note` varchar(256) collate utf8_czech_ci NOT NULL,
257 PRIMARY KEY (`vendor_id`),
258 UNIQUE KEY `vendor_name` (`vendor_name`)
0835e907 259) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
260SET character_set_client = @saved_cs_client;
261
262--
263-- Dumping data for table `vendor`
264--
265
266LOCK TABLES `vendor` WRITE;
267/*!40000 ALTER TABLE `vendor` DISABLE KEYS */;
268INSERT INTO `vendor` VALUES (1,'C.C.S.E','Czech Company Selling Everything'),(2,'Trolo Cybernetix','trololo');
269/*!40000 ALTER TABLE `vendor` ENABLE KEYS */;
270UNLOCK TABLES;
271/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
272
273/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
274/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
275/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
276/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
277/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
278/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
279/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
280
0835e907 281-- Dump completed on 2011-07-29 3:44:28
This page took 0.352908 seconds and 4 git commands to generate.