-
Notifications
You must be signed in to change notification settings - Fork 1
/
NorthwindProject.sql
25 lines (23 loc) · 1003 Bytes
/
NorthwindProject.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CREATE TABLE [dbo].[Users] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[FirstName] NVARCHAR (50) NOT NULL,
[LastName] NVARCHAR (50) NOT NULL,
[Email] NVARCHAR (50) NOT NULL,
[PasswordHash] VARBINARY(500) NOT NULL,
[PasswordSalt] VARBINARY(500) NOT NULL,
[Status] BIT NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
CREATE TABLE [dbo].[UserOperationClaims] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[UserId] INT NOT NULL,
[OperationClaimId] INT NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_UserOperationClaims_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([Id]),
CONSTRAINT [FK_UserOperationClaims_OperationClaims] FOREIGN KEY ([OperationClaimId]) REFERENCES [dbo].[OperationClaims] ([Id])
);
CREATE TABLE [dbo].[OperationClaims] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] VARCHAR (250) NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);