Jump to content

Delete Status options


coupe-r

Recommended Posts

Hi All,

 

Which is better to use in your tables?  I don't want to make it bigger than it has to, but would like to know who deletes records and when they are deleted.

 

deleteStatus = 1 or 0

 

OR

 

deletedOn = DATETIME

deletedBy = INTEGER

Link to comment
Share on other sites

Well, the first option wouldn't and that was my question.  Have 2 fields about deleteStatus won't really affect the DB performance, correct?  So I could / should include the time/date and user_id who deleted it?

Link to comment
Share on other sites

You are right: one field to track who and one field to track when, and no performance hit for it.

Make both fields nullable so you can tell whether it was deleted or not (it was if the fields are non-null, it was not if they are null).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.