Created
April 7, 2012 13:20
-
-
Save vekexasia/2328838 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 IF NOT EXISTS `resetpasswordtokens` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`userID` int(11) NOT NULL, | |
`token` char(32) NOT NULL, | |
`status` set('used','new') NOT NULL DEFAULT 'new', | |
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`id`), | |
KEY `userID` (`userID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; |
CREATE TABLE IF NOT EXISTS `resetpasswordtokens` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userID` int(11) NOT NULL,
`token` char(32) NOT NULL,
`consumed` boolean DEFAULT 0,
`expired` boolean DEFAULT 0,
`expirationDate` timestamp NULL,
PRIMARY KEY (`id`),
KEY `userID` (`userID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the work of Status here?