Dokumentace (TODO, README)
[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,
b4dcae05 55 `item_quantity` int(11) NOT NULL default '1',
b66fadbb
TM
56 `room_id` int(11) NOT NULL default '1',
57 `status_id` int(11) NOT NULL default '1',
cdfce7c2
TM
58 `item_price_in` decimal(9,2) NOT NULL default '0.00',
59 `item_price_out` decimal(9,2) default NULL,
b895e8ea 60 `item_customer` int(11) default NULL,
95548bc4 61 `item_note` varchar(512) collate utf8_czech_ci default NULL,
b4dcae05 62 `item_author` int(11) NOT NULL,
b66fadbb 63 `item_valid_till` timestamp NOT NULL default '0000-00-00 00:00:00',
b4dcae05 64 `item_valid_from` timestamp NULL default CURRENT_TIMESTAMP,
b66fadbb 65 PRIMARY KEY (`item_id`,`item_valid_till`),
b4dcae05 66 UNIQUE KEY `item_serial_item_valid_till` (`item_serial`,`item_valid_till`),
0835e907
TM
67 KEY `vendor_id` (`vendor_id`),
68 KEY `model_id` (`model_id`),
69 KEY `status_id` (`status_id`),
70 KEY `room_id` (`room_id`),
71 CONSTRAINT `item_ibfk_6` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`vendor_id`),
72 CONSTRAINT `item_ibfk_7` FOREIGN KEY (`model_id`) REFERENCES `model` (`model_id`),
73 CONSTRAINT `item_ibfk_8` FOREIGN KEY (`status_id`) REFERENCES `status` (`status_id`),
74 CONSTRAINT `item_ibfk_9` FOREIGN KEY (`room_id`) REFERENCES `room` (`room_id`)
aeed9d10 75) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
76SET character_set_client = @saved_cs_client;
77
78--
79-- Dumping data for table `item`
80--
81
82LOCK TABLES `item` WRITE;
83/*!40000 ALTER TABLE `item` DISABLE KEYS */;
aeed9d10 84INSERT INTO `item` VALUES (25,1,1,'sdaTEST3',1,1,3,'23.00','23.00',0,'',23,'0000-00-00 00:00:00','2011-08-25 21:19:26'),(25,1,1,'sdaTEST3',3,1,3,'0.00','0.00',NULL,NULL,23,'2011-08-20 00:13:26','2011-08-06 03:07:37'),(25,1,1,'sdaTEST3',3,1,3,'23.00','0.00',0,'',23,'2011-08-25 21:16:17','2011-08-20 00:13:26'),(25,1,1,'sdaTEST3',1,1,3,'23.00','0.00',0,'',23,'2011-08-25 21:19:26','2011-08-25 21:16:18'),(26,2,1,'ABC123',1,1,3,'555.00','777.00',0,'',23,'0000-00-00 00:00:00','2011-08-25 21:19:01'),(26,2,1,'ABC123',900,1,3,'0.00','0.00',NULL,NULL,23,'2011-08-25 21:16:27','2011-08-08 03:57:55'),(26,2,1,'ABC123',1,1,3,'0.00','0.00',0,'',23,'2011-08-25 21:19:01','2011-08-25 21:16:27'),(27,2,1,'deleteme8',1,1,1,'500.00','700.00',0,'',23,'0000-00-00 00:00:00','2011-08-25 21:18:44'),(27,2,1,'deleteme',900,1,3,'0.00','0.00',NULL,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,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,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,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,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,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,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,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,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,NULL,23,'2011-08-09 01:51:43','2011-08-09 01:51:13'),(27,2,1,'deleteme8',900,1,1,'0.00','0.00',NULL,NULL,23,'2011-08-25 21:16:34','2011-08-09 01:51:43'),(27,2,1,'deleteme8',1,1,1,'0.00','0.00',0,'',23,'2011-08-25 21:18:44','2011-08-25 21:16:35'),(31,2,1,'seriáál',1,1,1,'600.00','666.00',0,'',23,'0000-00-00 00:00:00','2011-08-25 21:18:16'),(31,2,1,'seriáál',1,1,1,'0.00','0.00',NULL,NULL,23,'2011-08-25 21:18:16','2011-08-09 02:36:26'),(33,3,1,'KG23',12,1,1,'84.00','108.00',0,'',23,'0000-00-00 00:00:00','2011-08-25 21:02:45'),(33,3,1,'KG23',24,1,1,'0.00','666.00',0,'',23,'2011-08-25 16:25:04','2011-08-25 15:50:08'),(33,3,1,'KG23',24,1,1,'168.00','216.00',0,'',23,'2011-08-25 20:44:44','2011-08-25 16:25:04'),(33,3,1,'KG23',23,1,1,'161.00','207.00',0,'',23,'2011-08-25 20:46:45','2011-08-25 20:44:44'),(33,3,1,'KG23',13,1,1,'91.00','117.00',0,'',23,'2011-08-25 21:02:45','2011-08-25 20:46:45'),(35,3,1,'KG23@@1314305191',10,1,2,'70.00','90.00',0,'nekde',23,'0000-00-00 00:00:00','2011-08-25 20:46:45'),(36,3,1,'KG23@0@1314306128',1,1,2,'7.00','9.00',0,'kgdisp',23,'0000-00-00 00:00:00','2011-08-25 21:02:45');
cdfce7c2
TM
85/*!40000 ALTER TABLE `item` ENABLE KEYS */;
86UNLOCK TABLES;
87
88--
89-- Table structure for table `model`
90--
91
92DROP TABLE IF EXISTS `model`;
93SET @saved_cs_client = @@character_set_client;
94SET character_set_client = utf8;
95CREATE TABLE `model` (
96 `model_id` int(11) NOT NULL auto_increment,
97 `model_name` varchar(64) collate utf8_czech_ci NOT NULL,
98 `producer_id` int(11) NOT NULL default '0',
99 `category_id` int(11) NOT NULL default '0',
100 `model_barcode` varchar(128) collate utf8_czech_ci NOT NULL,
aeed9d10
TM
101 `model_countable` int(1) NOT NULL default '1',
102 `model_price_in` decimal(9,2) default NULL,
cdfce7c2
TM
103 `model_price_out` decimal(9,2) default NULL,
104 `model_descript` varchar(1024) collate utf8_czech_ci NOT NULL,
105 PRIMARY KEY (`model_id`),
0835e907
TM
106 UNIQUE KEY `model_barcode` (`model_barcode`),
107 KEY `category_id` (`category_id`),
108 KEY `producer_id` (`producer_id`),
109 CONSTRAINT `model_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`),
110 CONSTRAINT `model_ibfk_2` FOREIGN KEY (`producer_id`) REFERENCES `producer` (`producer_id`)
aeed9d10 111) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
112SET character_set_client = @saved_cs_client;
113
114--
115-- Dumping data for table `model`
116--
117
118LOCK TABLES `model` WRITE;
119/*!40000 ALTER TABLE `model` DISABLE KEYS */;
aeed9d10 120INSERT INTO `model` VALUES (1,'Rushkoff: Klub extáze',1,1,'9788086096599',1,'13.00','23.00','prvni vec s carovym kodem co sem videl'),(2,'Bitevní tank',1,2,'BT23',1,'42.00','42.23','autoradio v cene'),(3,'Karel Gott - kompletní diskografie',2,2,'KG23',0,'7.00','9.00','možno použít i k sebeobranným účelům');
cdfce7c2
TM
121/*!40000 ALTER TABLE `model` ENABLE KEYS */;
122UNLOCK TABLES;
123
124--
125-- Table structure for table `producer`
126--
127
128DROP TABLE IF EXISTS `producer`;
129SET @saved_cs_client = @@character_set_client;
130SET character_set_client = utf8;
131CREATE TABLE `producer` (
132 `producer_id` int(11) NOT NULL auto_increment,
133 `producer_name` varchar(64) collate utf8_czech_ci NOT NULL,
134 `producer_note` varchar(512) collate utf8_czech_ci NOT NULL,
135 PRIMARY KEY (`producer_id`),
136 UNIQUE KEY `producer_name` (`producer_name`)
0835e907 137) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
138SET character_set_client = @saved_cs_client;
139
140--
141-- Dumping data for table `producer`
142--
143
144LOCK TABLES `producer` WRITE;
145/*!40000 ALTER TABLE `producer` DISABLE KEYS */;
146INSERT INTO `producer` VALUES (1,'C.C.M.E','Czech Company Making Everything'),(2,'AchAchne Labz','Ach ne');
147/*!40000 ALTER TABLE `producer` ENABLE KEYS */;
148UNLOCK TABLES;
149
cdfce7c2
TM
150--
151-- Table structure for table `room`
152--
153
154DROP TABLE IF EXISTS `room`;
155SET @saved_cs_client = @@character_set_client;
156SET character_set_client = utf8;
157CREATE TABLE `room` (
158 `room_id` int(11) NOT NULL auto_increment,
159 `room_name` varchar(64) collate utf8_czech_ci NOT NULL,
326a9fc9 160 `room_author` int(11) NOT NULL default '0',
cdfce7c2
TM
161 `room_descript` text collate utf8_czech_ci NOT NULL,
162 PRIMARY KEY (`room_id`),
0835e907 163 UNIQUE KEY `room_name` (`room_name`),
326a9fc9 164 KEY `user_id` (`room_author`)
0835e907 165) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
166SET character_set_client = @saved_cs_client;
167
168--
169-- Dumping data for table `room`
170--
171
172LOCK TABLES `room` WRITE;
173/*!40000 ALTER TABLE `room` DISABLE KEYS */;
174INSERT INTO `room` VALUES (1,'BarvyLaky',0,'LakyBarvy');
175/*!40000 ALTER TABLE `room` ENABLE KEYS */;
176UNLOCK TABLES;
177
178--
179-- Table structure for table `status`
180--
181
182DROP TABLE IF EXISTS `status`;
183SET @saved_cs_client = @@character_set_client;
184SET character_set_client = utf8;
185CREATE TABLE `status` (
186 `status_id` int(11) NOT NULL auto_increment,
187 `status_name` varchar(16) collate utf8_czech_ci NOT NULL,
188 PRIMARY KEY (`status_id`),
189 UNIQUE KEY `status_name` (`status_name`)
b66fadbb 190) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
191SET character_set_client = @saved_cs_client;
192
193--
194-- Dumping data for table `status`
195--
196
197LOCK TABLES `status` WRITE;
198/*!40000 ALTER TABLE `status` DISABLE KEYS */;
bda4a4be 199INSERT INTO `status` VALUES (0,'deleted'),(4,'destroyed'),(2,'placed'),(3,'saled'),(1,'stored');
cdfce7c2
TM
200/*!40000 ALTER TABLE `status` ENABLE KEYS */;
201UNLOCK TABLES;
202
0835e907
TM
203--
204-- Table structure for table `user`
205--
206
207DROP TABLE IF EXISTS `user`;
208SET @saved_cs_client = @@character_set_client;
209SET character_set_client = utf8;
210CREATE TABLE `user` (
211 `user_id` int(11) NOT NULL default '0',
212 `user_permit` enum('user','admin') collate utf8_czech_ci NOT NULL default 'user',
b4dcae05 213 PRIMARY KEY (`user_id`)
0835e907
TM
214) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
215SET character_set_client = @saved_cs_client;
216
217--
218-- Dumping data for table `user`
219--
220
221LOCK TABLES `user` WRITE;
222/*!40000 ALTER TABLE `user` DISABLE KEYS */;
223/*!40000 ALTER TABLE `user` ENABLE KEYS */;
224UNLOCK TABLES;
225
cdfce7c2
TM
226--
227-- Table structure for table `vendor`
228--
229
230DROP TABLE IF EXISTS `vendor`;
231SET @saved_cs_client = @@character_set_client;
232SET character_set_client = utf8;
233CREATE TABLE `vendor` (
234 `vendor_id` int(11) NOT NULL auto_increment,
235 `vendor_name` varchar(64) collate utf8_czech_ci NOT NULL,
236 `vendor_note` varchar(256) collate utf8_czech_ci NOT NULL,
237 PRIMARY KEY (`vendor_id`),
238 UNIQUE KEY `vendor_name` (`vendor_name`)
0835e907 239) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
cdfce7c2
TM
240SET character_set_client = @saved_cs_client;
241
242--
243-- Dumping data for table `vendor`
244--
245
246LOCK TABLES `vendor` WRITE;
247/*!40000 ALTER TABLE `vendor` DISABLE KEYS */;
248INSERT INTO `vendor` VALUES (1,'C.C.S.E','Czech Company Selling Everything'),(2,'Trolo Cybernetix','trololo');
249/*!40000 ALTER TABLE `vendor` ENABLE KEYS */;
250UNLOCK TABLES;
251/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
252
253/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
254/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
255/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
256/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
257/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
258/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
259/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
260
aeed9d10 261-- Dump completed on 2011-08-26 0:30:05
This page took 0.291049 seconds and 4 git commands to generate.