views:

13

answers:

1

Hi, I have a question in designing a database for a web-CMS, I have a “Users” table to keep the user and their account information.What is the best way to arrange the user accounts which are removed. In first way, I can create a “DeletedUsers” table and keep the users information whose account has been removed or deleted. In second way ,I will just add a new column to the User table named “AccountProperty” which ony accept two values: “Active” and “Inactive”. To understand which accounts are still active and which are inactive or removed. Is there any better way?

+1  A: 

Your second option is clearly the best of the two, although personally I would define it as a boolean instead of an enum (it looks like AccountProperty is an enum).

Creating an additional table looks to me like a good way to open up for potential problems later on. (Could be that some bug in your application, or other circumstances add the user to DeletedUsers, but doesn't remove it from Users, just to name one). Setting the Active property to "false" seems cleaner.

kskjon