If one-time usage data, such as a confirmation code, should be stored in the same table

When a user registers an account, I issue a verification code, which is later used to verify the account. After verification, the account will be checked verified=1 , and the verification code will be erased. Should data such as a verification code be placed in a separate table?

+7
source share
2 answers

Of course, it is much better to store temporary data separately from non-temporary. There is no need to store this key in the accounts table. Have some tblVerificationCodes with FK in the accounts table, timestamps, etc. Etc. And delete (or archive, if necessary) data from this table whenever possible. This is a very good style.

+4
source

if you plan on storing some other data, such as verifyDate, ipAddress, etc., you should use a different table for verification information. But if you do not plan to use any data, and the column is β€œverified”, about validation, only one column can be stored in one table,

+2
source

All Articles