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

后端 未结 18 2362
忘了有多久
忘了有多久 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:52

    You need to have it in functional requirements. If it is not said there explicitly you will have to figure out it yourself.

    In most cases it is better to store such records in separate table. You then avoid various situations where one table refers another table and you need to decide should records in second table be treated as deleted as well or not.

提交回复
热议问题