revamping domain
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
CREATE TABLE [session].[Session]
|
||||
(
|
||||
Id BIGINT NOT NULL PRIMARY KEY IDENTITY,
|
||||
[Name] [session].[SessionName] NOT NULL UNIQUE,
|
||||
Created DATETIMEOFFSET NOT NULL DEFAULT SYSDATETIMEOFFSET(),
|
||||
GameOver BIT NOT NULL DEFAULT 0,
|
||||
DomainDocument [session].[JsonDocument] NOT NULL,
|
||||
[Name] AS JSON_VALUE(DomainDocument, '$.Name') UNIQUE,
|
||||
Player1Id BIGINT NOT NULL,
|
||||
Player2Id BIGINT NULL,
|
||||
|
||||
CONSTRAINT [BoardState must be json] CHECK (isjson(DomainDocument)=1),
|
||||
CONSTRAINT FK_Player1_User FOREIGN KEY (Player1Id) REFERENCES [user].[User] (Id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
|
||||
Reference in New Issue
Block a user