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,
138 `filename` varchar(256) DEFAULT NULL,
144 CONSTRAINT `Documents_ibfk_1` FOREIGN KEY (`dtid`) REFERENCES `DocumentType` (`dtid`)
145 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
146 /*!40101 SET character_set_client = @saved_cs_client */;
149 -- Dumping data for table `Documents`
152 LOCK TABLES `Documents` WRITE;
153 /*!40000 ALTER TABLE `Documents` DISABLE KEYS */;
154 /*!40000 ALTER TABLE `Documents` ENABLE KEYS */;
158 -- Table structure for table `History`
161 DROP TABLE IF EXISTS `History`;
162 /*!40101 SET @saved_cs_client = @@character_set_client */;
163 /*!40101 SET character_set_client = utf8 */;
164 CREATE TABLE `History` (
165 `uid` int(11) DEFAULT NULL,
166 `date` datetime DEFAULT NULL,
167 `note` varchar(100) DEFAULT NULL,
169 CONSTRAINT `History_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `User` (`uid`)
170 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
171 /*!40101 SET character_set_client = @saved_cs_client */;
174 -- Dumping data for table `History`
177 LOCK TABLES `History` WRITE;
178 /*!40000 ALTER TABLE `History` DISABLE KEYS */;
179 /*!40000 ALTER TABLE `History` ENABLE KEYS */;
183 -- Table structure for table `Location`
186 DROP TABLE IF EXISTS `Location`;
187 /*!40101 SET @saved_cs_client = @@character_set_client */;
188 /*!40101 SET character_set_client = utf8 */;
189 CREATE TABLE `Location` (
190 `lid` int(11) NOT NULL AUTO_INCREMENT,
191 `vid` int(11) DEFAULT NULL,
192 `address` varchar(100) DEFAULT NULL,
193 `city` varchar(64) DEFAULT NULL,
194 `state` varchar(64) DEFAULT NULL,
195 `country` varchar(64) DEFAULT NULL,
196 `code` varchar(32) DEFAULT NULL,
199 CONSTRAINT `Location_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`)
200 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
201 /*!40101 SET character_set_client = @saved_cs_client */;
204 -- Dumping data for table `Location`
207 LOCK TABLES `Location` WRITE;
208 /*!40000 ALTER TABLE `Location` DISABLE KEYS */;
209 /*!40000 ALTER TABLE `Location` ENABLE KEYS */;
213 -- Table structure for table `Notes`
216 DROP TABLE IF EXISTS `Notes`;
217 /*!40101 SET @saved_cs_client = @@character_set_client */;
218 /*!40101 SET character_set_client = utf8 */;
219 CREATE TABLE `Notes` (
220 `nid` int(11) NOT NULL AUTO_INCREMENT,
221 `poid` int(11) DEFAULT NULL,
222 `note` varchar(200) DEFAULT NULL,
224 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
225 /*!40101 SET character_set_client = @saved_cs_client */;
228 -- Dumping data for table `Notes`
231 LOCK TABLES `Notes` WRITE;
232 /*!40000 ALTER TABLE `Notes` DISABLE KEYS */;
233 /*!40000 ALTER TABLE `Notes` ENABLE KEYS */;
237 -- Table structure for table `PurchaseOrder`
240 DROP TABLE IF EXISTS `PurchaseOrder`;
241 /*!40101 SET @saved_cs_client = @@character_set_client */;
242 /*!40101 SET character_set_client = utf8 */;
243 CREATE TABLE `PurchaseOrder` (
244 `poid` int(11) NOT NULL AUTO_INCREMENT,
245 `vid` int(11) DEFAULT NULL,
246 `closed` tinyint(1) NOT NULL DEFAULT '0',
247 `poNumber` varchar(100) DEFAULT NULL,
248 `originalDate` date DEFAULT NULL,
249 `adjustedDate` date DEFAULT NULL,
250 `description` varchar(200) DEFAULT NULL,
251 PRIMARY KEY (`poid`),
253 CONSTRAINT `PurchaseOrder_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`)
254 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
255 /*!40101 SET character_set_client = @saved_cs_client */;
258 -- Dumping data for table `PurchaseOrder`
261 LOCK TABLES `PurchaseOrder` WRITE;
262 /*!40000 ALTER TABLE `PurchaseOrder` DISABLE KEYS */;
263 /*!40000 ALTER TABLE `PurchaseOrder` ENABLE KEYS */;
267 -- Table structure for table `User`
270 DROP TABLE IF EXISTS `User`;
271 /*!40101 SET @saved_cs_client = @@character_set_client */;
272 /*!40101 SET character_set_client = utf8 */;
273 CREATE TABLE `User` (
274 `uid` int(11) NOT NULL AUTO_INCREMENT,
275 `ucid` int(11) DEFAULT NULL,
276 `name` varchar(64) DEFAULT NULL,
277 `login` varchar(32) DEFAULT NULL,
278 `password` varchar(64) DEFAULT NULL,
281 CONSTRAINT `User_ibfk_1` FOREIGN KEY (`ucid`) REFERENCES `UserClass` (`ucid`)
282 ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
283 /*!40101 SET character_set_client = @saved_cs_client */;
286 -- Dumping data for table `User`
289 LOCK TABLES `User` WRITE;
290 /*!40000 ALTER TABLE `User` DISABLE KEYS */;
291 INSERT INTO `User` VALUES (1,1,'Administrator','admin','admin_123');
292 /*!40000 ALTER TABLE `User` ENABLE KEYS */;
296 -- Table structure for table `UserClass`
299 DROP TABLE IF EXISTS `UserClass`;
300 /*!40101 SET @saved_cs_client = @@character_set_client */;
301 /*!40101 SET character_set_client = utf8 */;
302 CREATE TABLE `UserClass` (
303 `ucid` int(11) NOT NULL AUTO_INCREMENT,
304 `privilegeLevel` int(11) NOT NULL DEFAULT '0',
305 `description` varchar(100) DEFAULT NULL,
307 ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
308 /*!40101 SET character_set_client = @saved_cs_client */;
311 -- Dumping data for table `UserClass`
314 LOCK TABLES `UserClass` WRITE;
315 /*!40000 ALTER TABLE `UserClass` DISABLE KEYS */;
316 INSERT INTO `UserClass` VALUES (1,1,'Administrator');
317 /*!40000 ALTER TABLE `UserClass` ENABLE KEYS */;
321 -- Table structure for table `Vendor`
324 DROP TABLE IF EXISTS `Vendor`;
325 /*!40101 SET @saved_cs_client = @@character_set_client */;
326 /*!40101 SET character_set_client = utf8 */;
327 CREATE TABLE `Vendor` (
328 `vid` int(11) NOT NULL AUTO_INCREMENT,
329 `vlid` int(11) DEFAULT NULL,
330 `signedNDA` tinyint(1) NOT NULL DEFAULT '0',
331 `name` varchar(100) DEFAULT NULL,
334 CONSTRAINT `Vendor_ibfk_1` FOREIGN KEY (`vlid`) REFERENCES `VendorLevel` (`vlid`)
335 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
336 /*!40101 SET character_set_client = @saved_cs_client */;
339 -- Dumping data for table `Vendor`
342 LOCK TABLES `Vendor` WRITE;
343 /*!40000 ALTER TABLE `Vendor` DISABLE KEYS */;
344 /*!40000 ALTER TABLE `Vendor` ENABLE KEYS */;
348 -- Table structure for table `VendorGroup`
351 DROP TABLE IF EXISTS `VendorGroup`;
352 /*!40101 SET @saved_cs_client = @@character_set_client */;
353 /*!40101 SET character_set_client = utf8 */;
354 CREATE TABLE `VendorGroup` (
355 `vgid` int(11) NOT NULL AUTO_INCREMENT,
356 `seqNo` int(4) NOT NULL,
357 `description` varchar(100) DEFAULT NULL,
359 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
360 /*!40101 SET character_set_client = @saved_cs_client */;
363 -- Dumping data for table `VendorGroup`
366 LOCK TABLES `VendorGroup` WRITE;
367 /*!40000 ALTER TABLE `VendorGroup` DISABLE KEYS */;
368 /*!40000 ALTER TABLE `VendorGroup` ENABLE KEYS */;
372 -- Table structure for table `VendorLevel`
375 DROP TABLE IF EXISTS `VendorLevel`;
376 /*!40101 SET @saved_cs_client = @@character_set_client */;
377 /*!40101 SET character_set_client = utf8 */;
378 CREATE TABLE `VendorLevel` (
379 `vlid` int(11) NOT NULL AUTO_INCREMENT,
380 `vendorUsable` tinyint(1) NOT NULL DEFAULT '0',
381 `color` int(4) DEFAULT NULL,
382 `description` varchar(100) DEFAULT NULL,
384 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
385 /*!40101 SET character_set_client = @saved_cs_client */;
388 -- Dumping data for table `VendorLevel`
391 LOCK TABLES `VendorLevel` WRITE;
392 /*!40000 ALTER TABLE `VendorLevel` DISABLE KEYS */;
393 /*!40000 ALTER TABLE `VendorLevel` ENABLE KEYS */;
397 -- Table structure for table `VendorSpecificTypes`
400 DROP TABLE IF EXISTS `VendorSpecificTypes`;
401 /*!40101 SET @saved_cs_client = @@character_set_client */;
402 /*!40101 SET character_set_client = utf8 */;
403 CREATE TABLE `VendorSpecificTypes` (
404 `vid` int(11) DEFAULT NULL,
405 `vtid` int(11) DEFAULT NULL,
408 CONSTRAINT `VendorSpecificTypes_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`),
409 CONSTRAINT `VendorSpecificTypes_ibfk_2` FOREIGN KEY (`vtid`) REFERENCES `VendorType` (`vtid`)
410 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
411 /*!40101 SET character_set_client = @saved_cs_client */;
414 -- Dumping data for table `VendorSpecificTypes`
417 LOCK TABLES `VendorSpecificTypes` WRITE;
418 /*!40000 ALTER TABLE `VendorSpecificTypes` DISABLE KEYS */;
419 /*!40000 ALTER TABLE `VendorSpecificTypes` ENABLE KEYS */;
423 -- Table structure for table `VendorType`
426 DROP TABLE IF EXISTS `VendorType`;
427 /*!40101 SET @saved_cs_client = @@character_set_client */;
428 /*!40101 SET character_set_client = utf8 */;
429 CREATE TABLE `VendorType` (
430 `vtid` int(11) NOT NULL AUTO_INCREMENT,
431 `vgid` int(11) DEFAULT NULL,
432 `seqNo` int(4) NOT NULL,
433 `description` varchar(100) DEFAULT NULL,
434 PRIMARY KEY (`vtid`),
436 CONSTRAINT `VendorType_ibfk_1` FOREIGN KEY (`vgid`) REFERENCES `VendorGroup` (`vgid`)
437 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
438 /*!40101 SET character_set_client = @saved_cs_client */;
441 -- Dumping data for table `VendorType`
444 LOCK TABLES `VendorType` WRITE;
445 /*!40000 ALTER TABLE `VendorType` DISABLE KEYS */;
446 /*!40000 ALTER TABLE `VendorType` ENABLE KEYS */;
448 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
450 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
451 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
452 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
453 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
454 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
455 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
456 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
458 -- Dump completed on 2012-09-19 21:10:12