coupe-r Posted June 6, 2011 Share Posted June 6, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/238580-delete-status-options/ Share on other sites More sharing options...
requinix Posted June 6, 2011 Share Posted June 6, 2011 How does the first option even qualify? It doesn't say who or when the thing was deleted. Quote Link to comment https://forums.phpfreaks.com/topic/238580-delete-status-options/#findComment-1226049 Share on other sites More sharing options...
coupe-r Posted June 7, 2011 Author Share Posted June 7, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/238580-delete-status-options/#findComment-1226186 Share on other sites More sharing options...
requinix Posted June 7, 2011 Share Posted June 7, 2011 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). Quote Link to comment https://forums.phpfreaks.com/topic/238580-delete-status-options/#findComment-1226193 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.