· 8 years ago · Jun 26, 2018, 10:10 PM
1-
2-- Table structure for table `Anchorage`
3--
4
5DROP TABLE IF EXISTS `Anchorage`;
6/*!40101 SET @saved_cs_client = @@character_set_client */;
7/*!40101 SET character_set_client = utf8 */;
8CREATE TABLE `Anchorage` (
9 `idAnchorage` int(11) NOT NULL AUTO_INCREMENT,
10 `Capacity` int(11) DEFAULT NULL,
11 `MaxDraft` double DEFAULT NULL,
12 `CostPerHour` double DEFAULT NULL,
13 PRIMARY KEY (`idAnchorage`)
14) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;
15/*!40101 SET character_set_client = @saved_cs_client */;
16
17
18--
19-- Table structure for table `Dock`
20--
21
22DROP TABLE IF EXISTS `Dock`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `Dock` (
26 `idDock` int(11) NOT NULL AUTO_INCREMENT,
27 `MaxDraft` double DEFAULT '0',
28 `ContainersPerHour` int(11) DEFAULT '0',
29 `PassengersPerHour` int(11) DEFAULT '0',
30 `CostPerHour` double DEFAULT '0',
31 `Capacity` int(11) DEFAULT '0',
32 PRIMARY KEY (`idDock`)
33) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
34/*!40101 SET character_set_client = @saved_cs_client */;
35
36
37--
38-- Table structure for table `GeoCoordinate`
39--
40
41DROP TABLE IF EXISTS `GeoCoordinate`;
42/*!40101 SET @saved_cs_client = @@character_set_client */;
43/*!40101 SET character_set_client = utf8 */;
44CREATE TABLE `GeoCoordinate` (
45 `Name` varchar(45) NOT NULL,
46 `Latitude` double NOT NULL,
47 `Longitude` double NOT NULL,
48 PRIMARY KEY (`Name`)
49) ENGINE=InnoDB DEFAULT CHARSET=latin1;
50/*!40101 SET character_set_client = @saved_cs_client */;
51
52--
53-- Table structure for table `Port`
54--
55
56DROP TABLE IF EXISTS `Port`;
57/*!40101 SET @saved_cs_client = @@character_set_client */;
58/*!40101 SET character_set_client = utf8 */;
59CREATE TABLE `Port` (
60 `idPort` int(10) unsigned NOT NULL AUTO_INCREMENT,
61 `Name` varchar(45) NOT NULL,
62 `Owner` varchar(45) NOT NULL,
63 `GeoLatitude` double DEFAULT NULL,
64 `GeoLongitude` double DEFAULT NULL,
65 `NumberOfTugboats` int(11) DEFAULT NULL,
66 `NumberOfCorridors` int(11) DEFAULT NULL,
67 `NumberOfDocks` int(11) DEFAULT NULL,
68 `PointerAnchorage` int(11) DEFAULT NULL,
69 `PointerCorridor` int(11) DEFAULT NULL,
70 `PointerDock` int(11) DEFAULT NULL,
71 `warehouseCap` int(11) NOT NULL DEFAULT '0',
72 PRIMARY KEY (`idPort`),
73 UNIQUE KEY `idPort_UNIQUE` (`idPort`),
74 UNIQUE KEY `Name_UNIQUE` (`Name`),
75 KEY `PointerAnchorage_idx` (`PointerAnchorage`),
76 KEY `FK_PortTransportCorridor_idx` (`PointerCorridor`),
77 KEY `FK_PortDock_idx` (`PointerDock`),
78 CONSTRAINT `FK_PortAnchorage` FOREIGN KEY (`PointerAnchorage`) REFERENCES `Anchorage` (`idAnchorage`) ON DELETE NO ACTION ON UPDATE NO ACTION,
79 CONSTRAINT `FK_PortDock` FOREIGN KEY (`PointerDock`) REFERENCES `Dock` (`idDock`) ON DELETE NO ACTION ON UPDATE NO ACTION,
80 CONSTRAINT `FK_PortTransportCorridor` FOREIGN KEY (`PointerCorridor`) REFERENCES `TransportCorridor` (`idTransportCorridor`) ON DELETE NO ACTION ON UPDATE NO ACTION
81) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
82/*!40101 SET character_set_client = @saved_cs_client */;
83
84--
85-- Table structure for table `TransportCorridor`
86--
87
88DROP TABLE IF EXISTS `TransportCorridor`;
89/*!40101 SET @saved_cs_client = @@character_set_client */;
90/*!40101 SET character_set_client = utf8 */;
91CREATE TABLE `TransportCorridor` (
92 `idTransportCorridor` int(11) NOT NULL AUTO_INCREMENT,
93 `MaxSpeed` int(11) DEFAULT '0',
94 `MaxWidth` double DEFAULT '0',
95 `MaxDraft` double DEFAULT '0',
96 `CostPerHour` double DEFAULT '0',
97 `CapPerCorridor` int(11) DEFAULT '1',
98 PRIMARY KEY (`idTransportCorridor`)
99) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;
100/*!40101 SET character_set_client = @saved_cs_client */;
101
102--
103-- Table structure for table `Users`
104--
105
106DROP TABLE IF EXISTS `Users`;
107/*!40101 SET @saved_cs_client = @@character_set_client */;
108/*!40101 SET character_set_client = utf8 */;
109CREATE TABLE `Users` (
110 `UserID` int(11) NOT NULL AUTO_INCREMENT,
111 `Username` varchar(45) NOT NULL,
112 `HashedPassword` varchar(45) NOT NULL,
113 `AccountType` varchar(45) NOT NULL,
114 `isActive` tinyint(4) NOT NULL,
115 PRIMARY KEY (`UserID`)
116) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
117/*!40101 SET character_set_client = @saved_cs_client */;