Should 1-time use data like verification code to be stored in the same table
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,
精彩评论