This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tables.txt
79 lines (69 loc) · 2.36 KB
/
tables.txt
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
User:
UserId; type = serial, NOT NULL, primary key
FirstName; type = text
LastName; type = text
Email; type = text, NOT NULL
Password; type = text, NOT NULL
HomeLocation; type = text, NOT NULL
Reputation; type = integer
About; type = text
ProjectInterests; type = text
Photo; type = bytea
Space:
SpaceId; type = serial, NOT NULL, primary key
OwnerId; type = serial, NOT NULL, REFERENCES User.UserId
SpaceName: type = text
Location; type = text, NOT NULL
Description; type = text
SpaceType; type = text, NOT NULL
Area; type = integer (square feet), NOT NULL
Rooms; type = integer (number of rooms), NOT NULL
PricePerDay; type = numeric, NOT NULL
VacancyAmount; type = integer, NOT NULL
Leasing:
PRIMARY KEY(SpaceId, TenantId)
SpaceId; type = serial, NOT NULL, REFERENCES Space.SpaceId
TenantId; type = serial, NOT NULL, REFERENCES User.UserId
FromDate; type = date, NOT NULL
ToDate; type = date, NOT NULL
NegotiatedPricePerDay; type = numeric, NOT NULL
Availability:
PRIMARY KEY(SpaceId, FromDate, ToDate)
SpaceId; type = serial, NOT NULL, REFERENCES Space.SpaceId
FromDate; type = date, NOT NULL
ToDate; type = date, NOT NULL
ForumPost:
ForumPostId; type = serial, NOT NULL
UserId; type = serial, NOT NULL, REFERENCES User.UserId
SpaceId; type = serial, NOT NULL, REFERENCES Space.SpaceId
Text; type = text
DateTimePosted; type = timestamp without timezone, NOT NULL
ProjectTag; type = text
Applications:
PRIMARY KEY (SpaceId, FromDate, ToDate)
UserId; type = integer, NOT NULL, REFERENCES User.UserId
SpaceId; type = integer, NOT NULL, REFERENCES Space.SpaceId
FromDate; type = date
ToDate; type = date
AppId; type = serial, NOT NULL
Teams:
PRIMARY KEY (TeamId)
UserId; type = integer, REFERENCES User.UserId
SpaceId; type = integer, REFERENCES Space SpaceId
TeamName; type = text, NOT NULL
TeamDescription = type = text, NOT NULL,
TeamId; type = serial, NOT NULL,
TeamMembers:
PRIMARY KEY(TeamId, UserID)
TeamId; type = integer, REFERENCES Teams.TeamId
UserId; type = integer, REFERENCES User.UserId
SpaceRating:
PRIMARY KEY (UserId, SpaceId)
UserId; type = serial, NOT NULL, REFERENCES User.UserId
SpaceId; type = serial, NOT NULL, REFERENCES Space.SpaceId
LikeDislike; type = integer, NOT NULL
UserRating:
PRIMARY KEY (UserId, FriendUserId)
UserId; type = serial, NOT NULL, REFERENCES User.UserId
FriendUserId; type = serial, NOT NULL, REFERENCES User.UserId
LikeDislike; type = integer, NOT NULL