开发者

If I have a users table but want e-mails to be usernames, should I simply have email/password as columns?

Or should I have username, email, password and set save username also as email?

edit: I am not using email as the pk but am using a unique index on the email

I feel l开发者_如何转开发ike if I decided to change to openid/usernames I can still do that in the future by adding another column


I'd do email/password. And if you ever want to add usernames you can upgrade it then. No need to use extra fields if they're the same and you don't need them.


Might as well just have the email column since it functions as both, no point in repeating data in your table. Just remember DO NOT SAVE PASSWORDS AS CLEARTEXT :) Also you should have a Primary Key id column

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜