Skip to content

Commit

Permalink
Fix Adventureworks Scaffold-DbContext generation
Browse files Browse the repository at this point in the history
The types of the properties specified for the foreign key
 {'Departmentid' : short} on entity type 'Employeedepartmenthistory
(Dictionary<string, object>)' do not match the types of the properties
in the principal key {'Departmentid' : int} on entity type 'Department
(Dictionary<string, object>)'. Provide properties that use the same
 types in the same order.
  • Loading branch information
gabidabet committed Sep 11, 2023
1 parent d7954d8 commit fbfbdf5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions adventureworks/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ CREATE SCHEMA HumanResources
)
CREATE TABLE EmployeeDepartmentHistory(
BusinessEntityID INT NOT NULL,
DepartmentID smallint NOT NULL,
ShiftID smallint NOT NULL, -- tinyint
DepartmentID INT NOT NULL,
ShiftID INT NOT NULL, -- tinyint
StartDate DATE NOT NULL,
EndDate DATE NULL,
ModifiedDate TIMESTAMP NOT NULL CONSTRAINT "DF_EmployeeDepartmentHistory_ModifiedDate" DEFAULT (NOW()),
Expand Down Expand Up @@ -495,7 +495,7 @@ CREATE SCHEMA Production
)
CREATE TABLE ProductInventory(
ProductID INT NOT NULL,
LocationID smallint NOT NULL,
LocationID INT NOT NULL,
Shelf varchar(10) NOT NULL,
Bin smallint NOT NULL, -- tinyint
Quantity smallint NOT NULL CONSTRAINT "DF_ProductInventory_Quantity" DEFAULT (0),
Expand Down Expand Up @@ -597,7 +597,7 @@ CREATE SCHEMA Production
StartDate TIMESTAMP NOT NULL,
EndDate TIMESTAMP NULL,
DueDate TIMESTAMP NOT NULL,
ScrapReasonID smallint NULL,
ScrapReasonID INT NULL,
ModifiedDate TIMESTAMP NOT NULL CONSTRAINT "DF_WorkOrder_ModifiedDate" DEFAULT (NOW()),
CONSTRAINT "CK_WorkOrder_OrderQty" CHECK (OrderQty > 0),
CONSTRAINT "CK_WorkOrder_ScrappedQty" CHECK (ScrappedQty >= 0),
Expand All @@ -607,7 +607,7 @@ CREATE SCHEMA Production
WorkOrderID INT NOT NULL,
ProductID INT NOT NULL,
OperationSequence smallint NOT NULL,
LocationID smallint NOT NULL,
LocationID INT NOT NULL,
ScheduledStartDate TIMESTAMP NOT NULL,
ScheduledEndDate TIMESTAMP NOT NULL,
ActualStartDate TIMESTAMP NULL,
Expand Down

0 comments on commit fbfbdf5

Please sign in to comment.