﻿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
)
