When it comes to databases, which is the best technical approach to use when a user want's to delete his profile/delete some of his products from a shopping card:
Actually delete the rows from the relational tables that have his id, using DELETE.
Don't DELETE any row, but change the value of a boolean COLUMN/enum COLUMN (let's call it valid/non-valid) from true to false/0 to 1 - this implies that whenever you wan't to select all the existing users/products you need a WHERE clause to filter only the ones that have true on this particular COLUMN.
I am asking this because I have spoken with two experienced DB developers and when I told them that I am really deleting rows from the tables in my MySQL database, they were shocked! One of them told me that she was taught never to delete already inserted rows from tables.
So I would like to find which is the best professional approach for this action.
Aucun commentaire:
Enregistrer un commentaire