revamping domain

This commit is contained in:
2022-10-30 18:36:23 -05:00
parent b8ac227199
commit 689de35c3b
16 changed files with 161 additions and 105 deletions

View File

@@ -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,