mysql - Never delete entries? Good idea? Usual? -
I am preparing a system and I do not think it is a good idea to give the end user the ability to delete entries In the database, I think that the way the user ends up often, once the administrator has given authority, the database can end in a mess and then turn to me to fix it.
Of course, they should be able to remove the entries or at least feel that they have done so, if they are set as an administrator.
So, I was thinking that entries in the All databases should be an "active" field. If they try to remove an entry, then it will only set the flag "false" or something similar. Then there will be a super supermarket, which will be my company team who can change this field.
I have already seen that I worked in another company, but I was thinking that this was a good idea. I can just make regular database backups and then roll back if they commit an error and adding this field will add some complexity to all queries.
What do you think? should I? Do you use this kind of trick in your applications?
In one of our databases, we have the transactional and dictionary record.
In some words, transactional records are things that you can not bring back in real life, like a call from a customer. You can change the caller's name, status, etc., but you can not dismiss the call yourself.
dictionaries records are things that you can change, such as city for the customer.
transactional records and things that take them were never removed, while all the rights with the dictionary can be removed.
"Things that bring them" I mean that as soon as the records appear in business rules, which can cause a transactional record, this record also is Transactional becomes .
As such, a city can be removed from the database, but when one rule unfolds that " Moscow " to all customers " sms Send, cities were created as a record of transactional , or we were not able to answer the question "why it was sent sms ".
One of the rules for thumb was the privilege: Is this the only business of my company?
If one of my employees has data from the database (Eg, he made a report on which some management decision was made, and then the data report was based on the disappearance), these data are considered okay for removal.
But If this decision affects some immediate actions with the customers (such as calling, messing with the customer's balance etc.), everything that led to these decisions was kept forever.
This one Trade may vary from model to: Sometimes, even internal data may need to be recorded, sometimes it is ok to delete this data that affects the external world.
But the ode to our business, the rules from above worked fine.
Comments
Post a Comment