-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.txt
48 lines (46 loc) · 976 Bytes
/
schema.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
Table CarOwner as CO {
Id bigint [pk, increment]
Name varchar (500)
Surname varchar (500)
Phone varchar (500)
Email varchar (500)
PassportID var(500)
}
Table Car as C {
Id bigint [pk, increment]
CarOwnerId int
NumberPanel int
Color var(500)
Brand var(500)
Model var(500)
}
Table CarParkingOwner as CPO {
Id bigint [pk, increment]
Name varchar (500)
Surname varchar (500)
Phone varchar (500)
Email varchar (500)
PassportID var(500)
}
Table ParkingSpace as PS {
Id bigint [pk, increment]
CarParkingOwnerId int
SpaceAddress varchar(500)
Latitude double
Longitude double
PhotoLink json
}
Table Contracts as Con {
Id guid [pk, increment]
CarOwnerId bigint
CarParkingOwnerId bigint
SpaceId bigint
ContractDateStart datetime
ContractDateStop datetime
Price int
}
Ref: CO.Id > C.CarOwnerId
Ref: CPO.Id > PS.CarParkingOwnerId
Ref: Con.CarOwnerId > CO.Id
Ref: Con.CarParkingOwnerId > CPO.Id
Ref: Con.SpaceId > PS.Id