Advertisement
otkalce

database user setup (JWT)

Apr 7th, 2024 (edited)
1,283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.02 KB | Source Code | 0 0
  1. CREATE TABLE [dbo].[USER] (
  2.   [Id] [INT] IDENTITY(1,1) NOT NULL,
  3.   [Username] [nvarchar](50) NOT NULL, -- Use this for login
  4.   [PwdHash] [nvarchar](256) NOT NULL, -- Use to check password hash
  5.   [PwdSalt] [nvarchar](256) NOT NULL, -- Additional level of security (random string)
  6.   [FirstName] [nvarchar](256) NOT NULL,
  7.   [LastName] [nvarchar](256) NOT NULL,
  8.   [Email] [nvarchar](256) NOT NULL,
  9.   [Phone] [nvarchar](256) NULL,
  10.   CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED (
  11.     [Id] ASC
  12.   )
  13. )
  14.  
  15. CREATE TABLE [dbo].[UserAudioPermission] (
  16.   [Id] [INT] NOT NULL,
  17.   [UserId] [INT] NOT NULL,
  18.   [AudioId] [INT] NOT NULL,
  19.   CONSTRAINT [PK_UserAudioPermission] PRIMARY KEY CLUSTERED
  20.   (
  21.     [Id] ASC
  22.   )
  23. )
  24. GO
  25.  
  26. ALTER TABLE [dbo].[UserAudioPermission] WITH CHECK
  27. ADD CONSTRAINT [FK_UserAudioPermission_Audio] FOREIGN KEY([AudioId])
  28. REFERENCES [dbo].[Audio] ([Id])
  29. GO
  30.  
  31. ALTER TABLE [dbo].[UserAudioPermission] WITH CHECK
  32. ADD CONSTRAINT [FK_UserAudioPermission_User] FOREIGN KEY([UserId])
  33. REFERENCES [dbo].[USER] ([Id])
  34. GO
Tags: sql jwt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement