-
-
Save space11/4ab288f34d2a21d635492eccd612abb9 to your computer and use it in GitHub Desktop.
Database schema for a password reset functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [DataBaseName].[dbo].[PasswordResetTokens] ( | |
[token] varchar(36) NOT NULL, // 36 characters to fit GUID with delimiters | |
[userId] int NOT NULL, | |
[lastUpdate] datetime NOT NULL, | |
[tokenUsed] bit NOT NULL, | |
CONSTRAINT PasswordResetTokens_PK PRIMARY KEY (token), | |
CONSTRAINT PasswordResetTokens_FK FOREIGN KEY (userId) REFERENCES [DataBaseName].[dbo].[User](id) | |
) GO | |
EXEC [DataBaseName].sys.sp_addextendedproperty 'MS_Description', 'Store Password Reset Tokens ', 'schema', 'dbo', 'table', 'PasswordResetTokens' GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment