CREATE TABLE [dbo].[User] (
	[Id]                 INT  IDENTITY (1, 1) NOT NULL,
	[UserName]           NVARCHAR (250) NOT NULL,
	[Name]				 NVARCHAR (150) NULL,
	[Surname]			 NVARCHAR (150) NULL,
	[MobileNumber]		 NVARCHAR (150) NULL,
	[Password]           NVARCHAR (MAX) NOT NULL,
	[PasswordHash]       NVARCHAR (MAX) NOT NULL,
	[SignUpDate]		 DATETIME      NULL,
	[LastLoginDate]      DATETIME      NULL,
	[MustChangePassword] BIT           NOT NULL,
	[ProfileId]          INT           NOT NULL,
	[RoleId]			 INT		   NOT NULL, 
	[IsActive] BIT NOT NULL DEFAULT 0, 
	[AccountVerified] BIT NOT NULL DEFAULT 0,
	CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED ([Id] ASC),
	CONSTRAINT [FK_User_Profile] FOREIGN KEY ([ProfileId]) REFERENCES [dbo].[Profile] ([Id]), 
	CONSTRAINT [FK_User_UserRole] FOREIGN KEY ([RoleId]) REFERENCES [UserRole]([Id])
);

