﻿CREATE TABLE [session].[BoardState]
(
	[Id] BIGINT NOT NULL PRIMARY KEY IDENTITY,
	[Document] NVARCHAR(max) NOT NULL,
	[SessionId] BIGINT NOT NULL,

	CONSTRAINT [Document must be json] CHECK (isjson(Document)=1),
	CONSTRAINT FK_BoardState_Session FOREIGN KEY (SessionId) 
		REFERENCES [session].[Session] (Id) ON DELETE CASCADE ON UPDATE CASCADE
)
