1 -- MySQL dump 10.13 Distrib 5.1.62, for pc-linux-gnu (x86_64)
3 -- Host: localhost Database: schematic
4 -- ------------------------------------------------------
5 -- Server version 5.1.62-log
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 `Alerts`
22 DROP TABLE IF EXISTS `Alerts`;
23 /*!40101 SET @saved_cs_client = @@character_set_client */;
24 /*!40101 SET character_set_client = utf8 */;
25 CREATE TABLE `Alerts` (
26 `aid` int(11) NOT NULL AUTO_INCREMENT,
27 `uid` int(11) DEFAULT NULL,
28 `nid` int(11) DEFAULT NULL,
29 `date` date DEFAULT NULL,
30 `description` varchar(200) DEFAULT NULL,
33 CONSTRAINT `Alerts_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `User` (`uid`)
34 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
35 /*!40101 SET character_set_client = @saved_cs_client */;
38 -- Dumping data for table `Alerts`
41 LOCK TABLES `Alerts` WRITE;
42 /*!40000 ALTER TABLE `Alerts` DISABLE KEYS */;
43 /*!40000 ALTER TABLE `Alerts` ENABLE KEYS */;
47 -- Table structure for table `Contact`
50 DROP TABLE IF EXISTS `Contact`;
51 /*!40101 SET @saved_cs_client = @@character_set_client */;
52 /*!40101 SET character_set_client = utf8 */;
53 CREATE TABLE `Contact` (
54 `cid` int(11) NOT NULL AUTO_INCREMENT,
55 `vid` int(11) DEFAULT NULL,
56 `CTID` int(11) DEFAULT NULL,
57 `name` varchar(64) DEFAULT NULL,
58 `email` varchar(64) DEFAULT NULL,
59 `address` varchar(200) DEFAULT NULL,
60 `phone1` varchar(32) DEFAULT NULL,
61 `phone2` varchar(32) DEFAULT NULL,
62 `fax` varchar(32) DEFAULT NULL,
66 CONSTRAINT `Contact_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`),
67 CONSTRAINT `Contact_ibfk_2` FOREIGN KEY (`CTID`) REFERENCES `ContactType` (`ctid`)
68 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
69 /*!40101 SET character_set_client = @saved_cs_client */;
72 -- Dumping data for table `Contact`
75 LOCK TABLES `Contact` WRITE;
76 /*!40000 ALTER TABLE `Contact` DISABLE KEYS */;
77 /*!40000 ALTER TABLE `Contact` ENABLE KEYS */;
81 -- Table structure for table `ContactType`
84 DROP TABLE IF EXISTS `ContactType`;
85 /*!40101 SET @saved_cs_client = @@character_set_client */;
86 /*!40101 SET character_set_client = utf8 */;
87 CREATE TABLE `ContactType` (
88 `ctid` int(11) NOT NULL AUTO_INCREMENT,
89 `description` varchar(100) DEFAULT NULL,
91 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
92 /*!40101 SET character_set_client = @saved_cs_client */;
95 -- Dumping data for table `ContactType`
98 LOCK TABLES `ContactType` WRITE;
99 /*!40000 ALTER TABLE `ContactType` DISABLE KEYS */;
100 /*!40000 ALTER TABLE `ContactType` ENABLE KEYS */;
104 -- Table structure for table `DocumentType`
107 DROP TABLE IF EXISTS `DocumentType`;
108 /*!40101 SET @saved_cs_client = @@character_set_client */;
109 /*!40101 SET character_set_client = utf8 */;
110 CREATE TABLE `DocumentType` (
111 `dtid` int(11) NOT NULL AUTO_INCREMENT,
112 `description` varchar(100) DEFAULT NULL,
114 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
115 /*!40101 SET character_set_client = @saved_cs_client */;
118 -- Dumping data for table `DocumentType`
121 LOCK TABLES `DocumentType` WRITE;
122 /*!40000 ALTER TABLE `DocumentType` DISABLE KEYS */;
123 /*!40000 ALTER TABLE `DocumentType` ENABLE KEYS */;
127 -- Table structure for table `Documents`
130 DROP TABLE IF EXISTS `Documents`;
131 /*!40101 SET @saved_cs_client = @@character_set_client */;
132 /*!40101 SET character_set_client = utf8 */;
133 CREATE TABLE `Documents` (
134 `did` int(11) NOT NULL AUTO_INCREMENT,
135 `dtid` int(11) DEFAULT NULL,
136 `vid` int(11) DEFAULT NULL,
137 `poid` int(11) DEFAULT NULL,
143 CONSTRAINT `Documents_ibfk_1` FOREIGN KEY (`dtid`) REFERENCES `DocumentType` (`dtid`)
144 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
145 /*!40101 SET character_set_client = @saved_cs_client */;
148 -- Dumping data for table `Documents`
151 LOCK TABLES `Documents` WRITE;
152 /*!40000 ALTER TABLE `Documents` DISABLE KEYS */;
153 /*!40000 ALTER TABLE `Documents` ENABLE KEYS */;
157 -- Table structure for table `History`
160 DROP TABLE IF EXISTS `History`;
161 /*!40101 SET @saved_cs_client = @@character_set_client */;
162 /*!40101 SET character_set_client = utf8 */;
163 CREATE TABLE `History` (
164 `uid` int(11) DEFAULT NULL,
165 `date` datetime DEFAULT NULL,
166 `note` varchar(100) DEFAULT NULL,
168 CONSTRAINT `History_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `User` (`uid`)
169 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
170 /*!40101 SET character_set_client = @saved_cs_client */;
173 -- Dumping data for table `History`
176 LOCK TABLES `History` WRITE;
177 /*!40000 ALTER TABLE `History` DISABLE KEYS */;
178 /*!40000 ALTER TABLE `History` ENABLE KEYS */;
182 -- Table structure for table `Notes`
185 DROP TABLE IF EXISTS `Notes`;
186 /*!40101 SET @saved_cs_client = @@character_set_client */;
187 /*!40101 SET character_set_client = utf8 */;
188 CREATE TABLE `Notes` (
189 `nid` int(11) NOT NULL AUTO_INCREMENT,
190 `poid` int(11) DEFAULT NULL,
191 `note` varchar(200) DEFAULT NULL,
193 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
194 /*!40101 SET character_set_client = @saved_cs_client */;
197 -- Dumping data for table `Notes`
200 LOCK TABLES `Notes` WRITE;
201 /*!40000 ALTER TABLE `Notes` DISABLE KEYS */;
202 /*!40000 ALTER TABLE `Notes` ENABLE KEYS */;
206 -- Table structure for table `PurchaseOrder`
209 DROP TABLE IF EXISTS `PurchaseOrder`;
210 /*!40101 SET @saved_cs_client = @@character_set_client */;
211 /*!40101 SET character_set_client = utf8 */;
212 CREATE TABLE `PurchaseOrder` (
213 `poid` int(11) NOT NULL AUTO_INCREMENT,
214 `vid` int(11) DEFAULT NULL,
215 `closed` tinyint(1) NOT NULL DEFAULT '0',
216 `description` varchar(200) DEFAULT NULL,
217 PRIMARY KEY (`poid`),
219 CONSTRAINT `PurchaseOrder_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`)
220 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
221 /*!40101 SET character_set_client = @saved_cs_client */;
224 -- Dumping data for table `PurchaseOrder`
227 LOCK TABLES `PurchaseOrder` WRITE;
228 /*!40000 ALTER TABLE `PurchaseOrder` DISABLE KEYS */;
229 /*!40000 ALTER TABLE `PurchaseOrder` ENABLE KEYS */;
233 -- Table structure for table `User`
236 DROP TABLE IF EXISTS `User`;
237 /*!40101 SET @saved_cs_client = @@character_set_client */;
238 /*!40101 SET character_set_client = utf8 */;
239 CREATE TABLE `User` (
240 `uid` int(11) NOT NULL AUTO_INCREMENT,
241 `ucid` int(11) DEFAULT NULL,
242 `name` varchar(64) DEFAULT NULL,
243 `login` varchar(32) DEFAULT NULL,
244 `password` varchar(64) DEFAULT NULL,
247 CONSTRAINT `User_ibfk_1` FOREIGN KEY (`ucid`) REFERENCES `UserClass` (`ucid`)
248 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
249 /*!40101 SET character_set_client = @saved_cs_client */;
252 -- Dumping data for table `User`
255 LOCK TABLES `User` WRITE;
256 /*!40000 ALTER TABLE `User` DISABLE KEYS */;
257 /*!40000 ALTER TABLE `User` ENABLE KEYS */;
261 -- Table structure for table `UserClass`
264 DROP TABLE IF EXISTS `UserClass`;
265 /*!40101 SET @saved_cs_client = @@character_set_client */;
266 /*!40101 SET character_set_client = utf8 */;
267 CREATE TABLE `UserClass` (
268 `ucid` int(11) NOT NULL AUTO_INCREMENT,
269 `privilegeLevel` int(11) NOT NULL DEFAULT '0',
270 `description` varchar(100) DEFAULT NULL,
272 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
273 /*!40101 SET character_set_client = @saved_cs_client */;
276 -- Dumping data for table `UserClass`
279 LOCK TABLES `UserClass` WRITE;
280 /*!40000 ALTER TABLE `UserClass` DISABLE KEYS */;
281 /*!40000 ALTER TABLE `UserClass` ENABLE KEYS */;
285 -- Table structure for table `Vendor`
288 DROP TABLE IF EXISTS `Vendor`;
289 /*!40101 SET @saved_cs_client = @@character_set_client */;
290 /*!40101 SET character_set_client = utf8 */;
291 CREATE TABLE `Vendor` (
292 `vid` int(11) NOT NULL AUTO_INCREMENT,
293 `vlid` int(11) DEFAULT NULL,
294 `name` varchar(100) DEFAULT NULL,
297 CONSTRAINT `Vendor_ibfk_1` FOREIGN KEY (`vlid`) REFERENCES `VendorLevel` (`vlid`)
298 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
299 /*!40101 SET character_set_client = @saved_cs_client */;
302 -- Dumping data for table `Vendor`
305 LOCK TABLES `Vendor` WRITE;
306 /*!40000 ALTER TABLE `Vendor` DISABLE KEYS */;
307 /*!40000 ALTER TABLE `Vendor` ENABLE KEYS */;
311 -- Table structure for table `VendorGroup`
314 DROP TABLE IF EXISTS `VendorGroup`;
315 /*!40101 SET @saved_cs_client = @@character_set_client */;
316 /*!40101 SET character_set_client = utf8 */;
317 CREATE TABLE `VendorGroup` (
318 `vgid` int(11) NOT NULL AUTO_INCREMENT,
319 `description` varchar(100) DEFAULT NULL,
321 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
322 /*!40101 SET character_set_client = @saved_cs_client */;
325 -- Dumping data for table `VendorGroup`
328 LOCK TABLES `VendorGroup` WRITE;
329 /*!40000 ALTER TABLE `VendorGroup` DISABLE KEYS */;
330 /*!40000 ALTER TABLE `VendorGroup` ENABLE KEYS */;
334 -- Table structure for table `VendorLevel`
337 DROP TABLE IF EXISTS `VendorLevel`;
338 /*!40101 SET @saved_cs_client = @@character_set_client */;
339 /*!40101 SET character_set_client = utf8 */;
340 CREATE TABLE `VendorLevel` (
341 `vlid` int(11) NOT NULL AUTO_INCREMENT,
342 `vendorUsable` tinyint(1) NOT NULL DEFAULT '0',
343 `color` int(4) DEFAULT NULL,
344 `description` varchar(100) DEFAULT NULL,
346 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
347 /*!40101 SET character_set_client = @saved_cs_client */;
350 -- Dumping data for table `VendorLevel`
353 LOCK TABLES `VendorLevel` WRITE;
354 /*!40000 ALTER TABLE `VendorLevel` DISABLE KEYS */;
355 /*!40000 ALTER TABLE `VendorLevel` ENABLE KEYS */;
359 -- Table structure for table `VendorSpecificTypes`
362 DROP TABLE IF EXISTS `VendorSpecificTypes`;
363 /*!40101 SET @saved_cs_client = @@character_set_client */;
364 /*!40101 SET character_set_client = utf8 */;
365 CREATE TABLE `VendorSpecificTypes` (
366 `vid` int(11) DEFAULT NULL,
367 `vtid` int(11) DEFAULT NULL,
370 CONSTRAINT `VendorSpecificTypes_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`),
371 CONSTRAINT `VendorSpecificTypes_ibfk_2` FOREIGN KEY (`vtid`) REFERENCES `VendorType` (`vtid`)
372 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
373 /*!40101 SET character_set_client = @saved_cs_client */;
376 -- Dumping data for table `VendorSpecificTypes`
379 LOCK TABLES `VendorSpecificTypes` WRITE;
380 /*!40000 ALTER TABLE `VendorSpecificTypes` DISABLE KEYS */;
381 /*!40000 ALTER TABLE `VendorSpecificTypes` ENABLE KEYS */;
385 -- Table structure for table `VendorType`
388 DROP TABLE IF EXISTS `VendorType`;
389 /*!40101 SET @saved_cs_client = @@character_set_client */;
390 /*!40101 SET character_set_client = utf8 */;
391 CREATE TABLE `VendorType` (
392 `vtid` int(11) NOT NULL AUTO_INCREMENT,
393 `vgid` int(11) DEFAULT NULL,
394 `description` varchar(100) DEFAULT NULL,
395 PRIMARY KEY (`vtid`),
397 CONSTRAINT `VendorType_ibfk_1` FOREIGN KEY (`vgid`) REFERENCES `VendorGroup` (`vgid`)
398 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
399 /*!40101 SET character_set_client = @saved_cs_client */;
402 -- Dumping data for table `VendorType`
405 LOCK TABLES `VendorType` WRITE;
406 /*!40000 ALTER TABLE `VendorType` DISABLE KEYS */;
407 /*!40000 ALTER TABLE `VendorType` ENABLE KEYS */;
409 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
411 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
412 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
413 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
414 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
415 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
416 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
417 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
419 -- Dump completed on 2012-09-18 19:39:04