开发者

Should 1-time use data like verification code to be stored in the same table

开发者 https://www.devze.com 2023-02-10 21:46 出处:网络
When a user registers an account, I issue a verification code that is later used to verify the account. Once verified, the account is marked verified=开发者_StackOverflow社区1 and the verification cod

When a user registers an account, I issue a verification code that is later used to verify the account. Once verified, the account is marked verified=开发者_StackOverflow社区1 and the verification code erased. Should such data like the verification code be placed in a separate table?


This is of course much better to store temporary data separate from nontemporary. There is no need to store that key in the account table. Have some tblVerificationCodes with FKs to the account table, timestamps etc etc and delete (or archieve if needed) data from this table when its possible. This is very good style.


if you plan to store some other data, like verificationDate, ipAddress, etc. you should use a different table for verification information. But if you do not plan to use any data, but the "verified" column, about the verification, only one column can be stored in the same table,

0

精彩评论

暂无评论...
验证码 换一张
取 消