Temporary users table or legitimate users table?
Posted
by John
on Stack Overflow
See other posts from Stack Overflow
or by John
Published on 2010-03-09T02:44:02Z
Indexed on
2010/03/09
2:51 UTC
Read the original article
Hit count: 316
database
|normalization
I have a freelance web application that lets users register for events. In my database, I have a t_events_applicants table with the column t_events_applications.user_id with a foreign key constraint linked to the t_users.user_id column. So this means only users who have registered with my web application can register for my web application's events.
My client would now like to allow non-registered users, users who do not have an entry in my t_user table, to register for events. These non-registered users only need to provide their name and email address to register for events.
Should I create a t_temporary_user table with columns name and email and then remove the t_events_applicants.user_id fk constraint? Or should I add un-registered users to the t_user table and then add a column called t_user.type where type can be 'registered' or 'non-registered'?
How do I decide which approach to go with?
A lot of times, I hesitate with either approach. I ask myself, "What if at a later time, a temporary user is allowed to become a fully registered user? Then maybe I should have only a t_user table. But then I also don't feel good about storing a lot of temporary users in t_user."
© Stack Overflow or respective owner