-
Notifications
You must be signed in to change notification settings - Fork 1
/
erdiagram.dbml
128 lines (107 loc) · 2.22 KB
/
erdiagram.dbml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Use DBML to define your database structure
// Docs: https://dbml.dbdiagram.io/docs
Table Package {
PackageID int [pk]
Destination int [ref: > Address.AddressID]
Origin int [ref: > Address.AddressID]
Sender int [ref: > Customer.CustomerID]
Recipient int [ref: > Customer.CustomerID]
TrackingID string
Priority bool
Type string
Weight double
Length double
Width double
Height double
Delivered bool
DeliveryRoute int [ref: > DeliveryRoute.RouteID]
MailID int [pk]
DeliveryRoute int [ref: > DeliveryRoute.RouteID]
}
Table PaymentMethod {
MethodID int [pk]
Name string [unique]
}
Table Payment {
PaymentID int [pk]
Date string
Amount double
Method int [ref: > PaymentMethod.MethodID]
PaymentID int [pk]
EmployeeID int [ref: > Employee.EmployeeID]
}
Table Customer {
CustomerID int [pk]
Phone string
Email string
LocationID int [ref: > Address.AddressID]
PaymentIDs int [ref: > Payment.PaymentID]
}
Table CardInfo {
CardID int [pk]
FirstName string
LastName string
CardNumber string
ExpirationDate string
CVV int
LocationID int [ref: > Address.AddressID]
}
Table Address {
AddressID int [pk]
StreetNum int
StreetName string
City string
State string
Zip int
LocationType string
}
Table Addresses {
CustomerID int
AddressID int
}
Table FacilityInfo {
FacilityID int [pk]
FacilityName string
AddressID int [ref: > Address.AddressID]
}
Table CustomerMail {
CustomerID int
MailID int
}
Table CommonCustomer {
CommonCustomerID int [pk]
CustomerID int
FirstName string
LastName string
}
Table CorpCustomer {
CorpID int [pk]
CorporationName string
}
Table Event {
MailID int
EventID int [pk]
EventType string
Time string
LocationID int
}
Table DeliveryRoute {
RouteID int [pk]
EmployeeID int [pk]
CourierID int
StartLocation int [ref: > Address.AddressID]
EndLocation int [ref: > Address.AddressID]
Schedule string [note: "List of delivery schedule"]
}
Table Employee {
EmployeeID int [pk]
EmployeeName string
EmployeeRole string
EmployeeID int [pk]
DeliveryRouteID int [ref: > DeliveryRoute.RouteID]
}
Table Transaction {
TransactionID int [pk]
// Other attributes...
EmployeeID int [ref: > Employee.EmployeeID]
}