Should I delete or disable a row in a relational database?

后端 未结 18 2251
忘了有多久
忘了有多久 2020-12-23 10:09

In a brand new program where space isn\'t really that big a deal, is it better to delete a row or to disable a row by let\'s say a boolean \"Disabled\" and have the program

18条回答
  •  醉梦人生
    2020-12-23 10:37

    It's up to you and your requirements (some things get rather hard when records exist that...don't).

    I will say that a boolean is a bad choice, though. Make it a nullable timestamp. It's pretty handy to know when something was deleted, especially when you deleted too much and want to undo part of the delete.

提交回复
热议问题