Move from the hand.
This commit is contained in:
@@ -4,12 +4,19 @@
|
||||
[SessionId] BIGINT NOT NULL,
|
||||
[To] VARCHAR(2) NOT NULL,
|
||||
[From] VARCHAR(2) NULL,
|
||||
[IsPromotion] BIT NULL,
|
||||
[PieceIdFromHand] INT NULL
|
||||
[PieceIdFromHand] INT NULL,
|
||||
[IsPromotion] BIT DEFAULT 0
|
||||
|
||||
CONSTRAINT [Cannot end where you start]
|
||||
CHECK ([From] <> [To]),
|
||||
|
||||
CONSTRAINT [Move cannot start from two places]
|
||||
CHECK (
|
||||
( [From] IS NOT NULL AND [PieceIdFromHand] IS NULL )
|
||||
OR
|
||||
( [From] IS NULL AND [PieceIdFromhand] IS NOT NULL )
|
||||
),
|
||||
|
||||
CONSTRAINT FK_Move_Session FOREIGN KEY (SessionId) REFERENCES [session].[Session] (Id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
|
||||
Reference in New Issue
Block a user