Files
Shogi/Shogi.Database/User/Tables/User.sql
2023-02-01 22:49:28 -06:00

13 lines
509 B
SQL

CREATE TABLE [user].[User]
(
[Id] BIGINT NOT NULL PRIMARY KEY IDENTITY, -- TODO: Consider using user.UserName as the PK to avoid confusing "Id" in the database vs "Id" in the domain model.
[Name] [user].[UserName] NOT NULL UNIQUE,
[DisplayName] NVARCHAR(100) NOT NULL,
[Platform] NVARCHAR(20) NOT NULL,
[CreatedDate] DATETIMEOFFSET DEFAULT SYSDATETIMEOFFSET()
CONSTRAINT User_Platform FOREIGN KEY ([Platform]) References [user].[LoginPlatform] ([Platform])
ON DELETE CASCADE
ON UPDATE CASCADE
)