-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:stevebrownlee/learn-ops-api
- Loading branch information
Showing
3 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
Table Order { | ||
Id int PK | ||
PaymentTypeId int | ||
CustomerId int | ||
CreatedAt datetime | ||
} | ||
|
||
Table Product { | ||
Id int PK | ||
Name varchar(50) | ||
CustomerId int | ||
Price decimal | ||
Description varchar(255) | ||
Quantity int | ||
Location varchar(75) | ||
ImagePath varchar(255) | ||
CreatedAt datetime | ||
ProductCategoryId int | ||
} | ||
|
||
Table ProductCategory { | ||
Id int pk | ||
Name varchar(55) | ||
} | ||
|
||
Table OrderProduct { | ||
OrderProductId int PK | ||
OrderId int | ||
ProductId int | ||
} | ||
|
||
Table Customer { | ||
Id int PK | ||
FirstName varchar(55) | ||
LastName varchar(55) | ||
Email varchar(55) | ||
CreatedAt datetime | ||
IsActive boolean | ||
} | ||
|
||
Table ProductRating { | ||
Id int pk | ||
CustomerId int | ||
ProductId int | ||
Score int | ||
} | ||
|
||
Ref FK_OrderProduct_Order { | ||
OrderProduct.OrderId > Order.Id | ||
} | ||
|
||
Ref FK_OrderProduct_Product { | ||
OrderProduct.ProductId > Product.Id | ||
} | ||
|
||
Ref FK_Product_Merchant { | ||
Product.CustomerId > Customer.Id | ||
} | ||
|
||
Table PaymentType { | ||
PaymentTypeId int PK | ||
MerchantName varchar(25) | ||
AcctNumber varchar(25) | ||
ExpirationDate datetime | ||
CustomerId int | ||
CreatedAt datetime | ||
} | ||
|
||
Table Favorite { | ||
Id int PK | ||
CustomerId int | ||
SellerId int | ||
} | ||
|
||
|
||
Table Recommendation { | ||
Id int PK | ||
RecommenderId int | ||
CustomerId int | ||
ProductId int | ||
} | ||
|
||
Ref FK_OrderPaymentType{ | ||
Order.PaymentTypeId > PaymentType.PaymentTypeId | ||
} | ||
|
||
Ref FK_OrderCustomer{ | ||
Order.CustomerId > Customer.Id | ||
} | ||
|
||
Ref: "Customer"."Id" < "ProductRating"."CustomerId" | ||
|
||
Ref: "Product"."Id" < "ProductRating"."ProductId" | ||
|
||
Ref: "Customer"."Id" < "Favorite"."CustomerId" | ||
|
||
Ref: "Customer"."Id" < "Favorite"."SellerId" | ||
|
||
Ref: "Customer"."Id" < "Recommendation"."RecommenderId" | ||
|
||
Ref: "Customer"."Id" < "Recommendation"."CustomerId" | ||
|
||
Ref: "Product"."Id" < "Recommendation"."ProductId" | ||
|
||
Ref: "ProductCategory"."Id" < "Product"."ProductCategoryId" |