-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatador_Database_grp2.sql
More file actions
84 lines (71 loc) · 2.69 KB
/
Copy pathMatador_Database_grp2.sql
File metadata and controls
84 lines (71 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
CREATE DATABASE IF NOT EXISTS `matador` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `matador`;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`usernumber` int(2) NOT NULL,
`userName` varchar(45) DEFAULT NULL,
`currentPosition` int(2) DEFAULT NULL,
`balance` int(11) DEFAULT NULL,
PRIMARY KEY (`usernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `street`
--
DROP TABLE IF EXISTS `street`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `street` (
`fieldNumber` int(2) NOT NULL,
`ownerNumber` int(2) DEFAULT NULL,
`houseAmount` int(1) DEFAULT NULL,
`hotelAmount` int(1) DEFAULT NULL,
PRIMARY KEY (`fieldNumber`),
KEY `userNumber_idx` (`ownerNumber`),
CONSTRAINT `fk_StreetUser` FOREIGN KEY (`ownerNumber`) REFERENCES `user` (`usernumber`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `shipping`
--
DROP TABLE IF EXISTS `shipping`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shipping` (
`fieldNumber` int(2) NOT NULL,
`ownerNumber` int(2) DEFAULT NULL,
PRIMARY KEY (`fieldNumber`),
KEY `fk_ShippingUser_idx` (`ownerNumber`),
CONSTRAINT `fk_ShippingUser` FOREIGN KEY (`ownerNumber`) REFERENCES `user` (`usernumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `brewery`
--
DROP TABLE IF EXISTS `brewery`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `brewery` (
`fieldNumber` int(2) NOT NULL,
`ownerNumber` int(2) DEFAULT NULL,
PRIMARY KEY (`fieldNumber`),
KEY `fk_BreweryUser_idx` (`ownerNumber`),
CONSTRAINT `fk_BreweryUser` FOREIGN KEY (`ownerNumber`) REFERENCES `user` (`usernumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `controller`
--
DROP TABLE IF EXISTS `controller`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `controller` (
`userTurn` int(11) NOT NULL,
PRIMARY KEY (`userTurn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;