3 -- Host: localhost Database: sklad
4 -- ------------------------------------------------------
5 -- Server version 5.0.51a-24+lenny5
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 */;
19 -- Table structure for table `category`
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
;
34 -- Dumping data for table `category`
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 */;
44 -- Table structure for table `item`
47 DROP TABLE IF EXISTS `item`
;
48 SET @saved_cs_client
= @@character_set_client
;
49 SET character_set_client
= utf8
;
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) NOT NULL default '1',
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 `item_note`
varchar(512) collate utf8_czech_ci
default NULL,
61 `item_author`
int(11) NOT NULL,
62 `item_valid_till`
timestamp NOT NULL default '0000-00-00 00:00:00',
63 `item_valid_from`
timestamp NULL default CURRENT_TIMESTAMP,
64 PRIMARY KEY (`item_id`
,`item_valid_till`
),
65 UNIQUE KEY `item_serial_item_valid_till`
(`item_serial`
,`item_valid_till`
),
66 KEY `vendor_id`
(`vendor_id`
),
67 KEY `model_id`
(`model_id`
),
68 KEY `status_id`
(`status_id`
),
69 KEY `room_id`
(`room_id`
),
70 CONSTRAINT `item_ibfk_6`
FOREIGN KEY (`vendor_id`
) REFERENCES `vendor`
(`vendor_id`
),
71 CONSTRAINT `item_ibfk_7`
FOREIGN KEY (`model_id`
) REFERENCES `model`
(`model_id`
),
72 CONSTRAINT `item_ibfk_8`
FOREIGN KEY (`status_id`
) REFERENCES `status`
(`status_id`
),
73 CONSTRAINT `item_ibfk_9`
FOREIGN KEY (`room_id`
) REFERENCES `room`
(`room_id`
)
74 ) ENGINE
=InnoDB AUTO_INCREMENT
=32 DEFAULT CHARSET
=utf8
COLLATE=utf8_czech_ci
;
75 SET character_set_client
= @saved_cs_client
;
78 -- Dumping data for table `item`
81 LOCK TABLES `item`
WRITE;
82 /*!40000 ALTER TABLE `item` DISABLE KEYS */;
83 INSERT INTO `item`
VALUES (9,3,2,'SATAN',0,1,1,'0.10','0.00',NULL,0,'0000-00-00 00:00:00','2011-08-06 02:37:43'),(25,1,1,'sdaTEST3',3,1,3,'0.00','0.00',NULL,23,'0000-00-00 00:00:00','2011-08-06 03:07:37'),(26,2,1,'ABC123',900,1,3,'0.00','0.00',NULL,23,'0000-00-00 00:00:00','2011-08-08 03:57:55'),(27,2,1,'deleteme8',900,1,1,'0.00','0.00',NULL,23,'0000-00-00 00:00:00','2011-08-09 01:51:43'),(27,2,1,'deleteme',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 00:01:10','2011-08-09 00:01:10'),(27,2,1,'deleteme2',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 00:01:23','2011-08-09 00:01:23'),(27,2,1,'deleteme3',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 00:02:04','2011-08-09 00:02:04'),(27,2,1,'deleteme4',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 00:26:07','2011-08-09 00:02:04'),(27,2,1,'deleteme5',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 00:29:09','2011-08-09 00:26:07'),(27,2,1,'deleteme6',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 00:31:04','2011-08-09 00:29:09'),(27,2,1,'deleteme7',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 00:31:50','2011-08-09 00:31:04'),(27,2,1,'deleteme8',900,1,3,'0.00','0.00',NULL,23,'2011-08-09 01:39:17','2011-08-09 00:31:50'),(27,3,1,'deleteme8',0,1,1,'0.00','0.00',NULL,23,'2011-08-09 01:51:13','2011-08-09 01:40:07'),(27,2,1,'deleteme8',0,1,1,'0.00','0.00',NULL,23,'2011-08-09 01:51:43','2011-08-09 01:51:13'),(31,2,1,'seriáál',1,1,1,'0.00','0.00',NULL,23,'0000-00-00 00:00:00','2011-08-09 02:36:26');
84 /*!40000 ALTER TABLE `item` ENABLE KEYS */;
88 -- Table structure for table `model`
91 DROP TABLE IF EXISTS `model`
;
92 SET @saved_cs_client
= @@character_set_client
;
93 SET character_set_client
= utf8
;
94 CREATE TABLE `model`
(
95 `model_id`
int(11) NOT NULL auto_increment
,
96 `model_name`
varchar(64) collate utf8_czech_ci
NOT NULL,
97 `producer_id`
int(11) NOT NULL default '0',
98 `category_id`
int(11) NOT NULL default '0',
99 `model_barcode`
varchar(128) collate utf8_czech_ci
NOT NULL,
100 `model_price_out`
decimal(9,2) default NULL,
101 `model_descript`
varchar(1024) collate utf8_czech_ci
NOT NULL,
102 PRIMARY KEY (`model_id`
),
103 UNIQUE KEY `model_barcode`
(`model_barcode`
),
104 KEY `category_id`
(`category_id`
),
105 KEY `producer_id`
(`producer_id`
),
106 CONSTRAINT `model_ibfk_1`
FOREIGN KEY (`category_id`
) REFERENCES `category`
(`category_id`
),
107 CONSTRAINT `model_ibfk_2`
FOREIGN KEY (`producer_id`
) REFERENCES `producer`
(`producer_id`
)
108 ) ENGINE
=InnoDB AUTO_INCREMENT
=5 DEFAULT CHARSET
=utf8
COLLATE=utf8_czech_ci
;
109 SET character_set_client
= @saved_cs_client
;
112 -- Dumping data for table `model`
115 LOCK TABLES `model`
WRITE;
116 /*!40000 ALTER TABLE `model` DISABLE KEYS */;
117 INSERT INTO `model`
VALUES (1,'Rushkoff: Klub extáze',1,1,'9788086096599','23.00','prvni vec s carovym kodem co sem videl'),(2,'Bitevní tank',1,2,'BT23','1.00','autoradio v cene'),(3,'Karel Gott - kompletní diskografie',2,2,'4792207502505','666.00','možno použít i k sebeobranným účelům');
118 /*!40000 ALTER TABLE `model` ENABLE KEYS */;
122 -- Table structure for table `producer`
125 DROP TABLE IF EXISTS `producer`
;
126 SET @saved_cs_client
= @@character_set_client
;
127 SET character_set_client
= utf8
;
128 CREATE TABLE `producer`
(
129 `producer_id`
int(11) NOT NULL auto_increment
,
130 `producer_name`
varchar(64) collate utf8_czech_ci
NOT NULL,
131 `producer_note`
varchar(512) collate utf8_czech_ci
NOT NULL,
132 PRIMARY KEY (`producer_id`
),
133 UNIQUE KEY `producer_name`
(`producer_name`
)
134 ) ENGINE
=InnoDB AUTO_INCREMENT
=3 DEFAULT CHARSET
=utf8
COLLATE=utf8_czech_ci
;
135 SET character_set_client
= @saved_cs_client
;
138 -- Dumping data for table `producer`
141 LOCK TABLES `producer`
WRITE;
142 /*!40000 ALTER TABLE `producer` DISABLE KEYS */;
143 INSERT INTO `producer`
VALUES (1,'C.C.M.E','Czech Company Making Everything'),(2,'AchAchne Labz','Ach ne');
144 /*!40000 ALTER TABLE `producer` ENABLE KEYS */;
148 -- Table structure for table `room`
151 DROP TABLE IF EXISTS `room`
;
152 SET @saved_cs_client
= @@character_set_client
;
153 SET character_set_client
= utf8
;
154 CREATE TABLE `room`
(
155 `room_id`
int(11) NOT NULL auto_increment
,
156 `room_name`
varchar(64) collate utf8_czech_ci
NOT NULL,
157 `user_id`
int(11) NOT NULL default '0',
158 `room_descript`
text collate utf8_czech_ci
NOT NULL,
159 PRIMARY KEY (`room_id`
),
160 UNIQUE KEY `room_name`
(`room_name`
),
161 KEY `user_id`
(`user_id`
)
162 ) ENGINE
=InnoDB AUTO_INCREMENT
=2 DEFAULT CHARSET
=utf8
COLLATE=utf8_czech_ci
;
163 SET character_set_client
= @saved_cs_client
;
166 -- Dumping data for table `room`
169 LOCK TABLES `room`
WRITE;
170 /*!40000 ALTER TABLE `room` DISABLE KEYS */;
171 INSERT INTO `room`
VALUES (1,'BarvyLaky',0,'LakyBarvy');
172 /*!40000 ALTER TABLE `room` ENABLE KEYS */;
176 -- Table structure for table `status`
179 DROP TABLE IF EXISTS `status`
;
180 SET @saved_cs_client
= @@character_set_client
;
181 SET character_set_client
= utf8
;
182 CREATE TABLE `status`
(
183 `status_id`
int(11) NOT NULL auto_increment
,
184 `status_name`
varchar(16) collate utf8_czech_ci
NOT NULL,
185 PRIMARY KEY (`status_id`
),
186 UNIQUE KEY `status_name`
(`status_name`
)
187 ) ENGINE
=InnoDB AUTO_INCREMENT
=6 DEFAULT CHARSET
=utf8
COLLATE=utf8_czech_ci
;
188 SET character_set_client
= @saved_cs_client
;
191 -- Dumping data for table `status`
194 LOCK TABLES `status`
WRITE;
195 /*!40000 ALTER TABLE `status` DISABLE KEYS */;
196 INSERT INTO `status`
VALUES (5,'DELETED'),(4,'destroyed'),(2,'placed'),(3,'saled'),(1,'stored');
197 /*!40000 ALTER TABLE `status` ENABLE KEYS */;
201 -- Table structure for table `user`
204 DROP TABLE IF EXISTS `
user`
;
205 SET @saved_cs_client
= @@character_set_client
;
206 SET character_set_client
= utf8
;
207 CREATE TABLE `
user`
(
208 `user_id`
int(11) NOT NULL default '0',
209 `user_permit`
enum('user','admin') collate utf8_czech_ci
NOT NULL default 'user',
210 PRIMARY KEY (`user_id`
)
211 ) ENGINE
=InnoDB
DEFAULT CHARSET
=utf8
COLLATE=utf8_czech_ci
;
212 SET character_set_client
= @saved_cs_client
;
215 -- Dumping data for table `user`
218 LOCK TABLES `
user`
WRITE;
219 /*!40000 ALTER TABLE `user` DISABLE KEYS */;
220 /*!40000 ALTER TABLE `user` ENABLE KEYS */;
224 -- Table structure for table `vendor`
227 DROP TABLE IF EXISTS `vendor`
;
228 SET @saved_cs_client
= @@character_set_client
;
229 SET character_set_client
= utf8
;
230 CREATE TABLE `vendor`
(
231 `vendor_id`
int(11) NOT NULL auto_increment
,
232 `vendor_name`
varchar(64) collate utf8_czech_ci
NOT NULL,
233 `vendor_note`
varchar(256) collate utf8_czech_ci
NOT NULL,
234 PRIMARY KEY (`vendor_id`
),
235 UNIQUE KEY `vendor_name`
(`vendor_name`
)
236 ) ENGINE
=InnoDB AUTO_INCREMENT
=3 DEFAULT CHARSET
=utf8
COLLATE=utf8_czech_ci
;
237 SET character_set_client
= @saved_cs_client
;
240 -- Dumping data for table `vendor`
243 LOCK TABLES `vendor`
WRITE;
244 /*!40000 ALTER TABLE `vendor` DISABLE KEYS */;
245 INSERT INTO `vendor`
VALUES (1,'C.C.S.E','Czech Company Selling Everything'),(2,'Trolo Cybernetix','trololo');
246 /*!40000 ALTER TABLE `vendor` ENABLE KEYS */;
248 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
250 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
251 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
252 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
253 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
254 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
255 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
256 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
258 -- Dump completed on 2011-08-18 22:37:39