Wednesday 15 July 2015

database - Should I just store email when its being used as username? -


When creating a user registration system, I am using the user's email as a user name

When creating database schemas, then should I assume them as 2 separate fields or should I assume them as 1?

For example.

  USER_TABLE {USER_ID, USERNAME, FNAME, LNAME, EMAIL}   

or

  USER_TABLE {USER_ID, USERNAME, FNAME, LNAME}   

I think the only argument to store 2 areas separately (even if they are the same) is for future proof of some kind, if we ever Decide to make a user a username which is not an email?

Thoughts?

I would like to avoid optimization ahead of time and will only use one field. If you ever need 2 fields, then it's easy to create and populate.

No comments:

Post a Comment