当前位置:网站首页>Use soft delete to delete data in database
Use soft delete to delete data in database
2020-11-10 11:27:00 【Oc ct0tt1c】
One . Soft delete ( Logical deletion ):(Soft Deleting), That is, when the data in the data table is deleted , It is not removed directly from the data table , It's marked as deleted , That is to set a delete field in each table ( Such as :IsDeleted) etc. , By default, the value is 0, And undeleted state ; When you need to delete data , Update this field to 1.
In reality , What we mean by deletion is not really deletion , Often we delete some data in the database after , It's hard to recover , In this way, it will be more convenient to use soft deletion to check again .
for example :
- company “ fire ” An employee , Instead of deleting employees ;
- company “ Cancel ” The order , Instead of deleting the order ;
- company “ Discontinue use ” A device , Instead of deleting a device ;
Here we're going to use dismissal , Cancel , Stop using instead of “ Delete ”;
When you want to see the data status again , As long as IsDeleted To change the value of 0 that will do .
Two . Hard delete ( Physical delete ): Really delete data from the database , The data disappears .
版权声明
本文为[Oc ct0tt1c]所创,转载请带上原文链接,感谢
边栏推荐
猜你喜欢
LeetCode:二叉树(四)
2020即将过去,新的一年不考虑入手一个超好用的云速建站吗?
[CCPC] 2020ccpc Changchun F - band memory | tree heuristic merge (DSU on a tree), chairman tree
Thoroughly understand the prototype of JS prototype chain__ proto__ And constructor (2)
One of the 10 Greatest formulas in the world is well known
C language uses random number to generate matrix to realize fast transposition of triples.
How to view the establishment of the new retail business department of Alibaba cloud?
Magicodes.IE 3.0重磅设计畅谈
[C#.NET 拾遗补漏]11:最基础的线程知识
Unity style transfer for person re identification
随机推荐
A professional tour -- a quick tour of GitHub hot spots Vol.45
Magicodes.IE 3.0 talk about heavy design
GNU assembly basic mathematical equations multiplication
Leetcode: binary tree (4)
Key layout of the Central Government: in the next five years, self-reliance and self-improvement of science and technology will be the priority, and these industries will be named
一个 Task 不够,又来一个 ValueTask ,真的学懵了!
Do not understand the code, can type can build a station? 1111 yuan gift bag to help you with one stop!
如何更好地理解中间件和洋葱模型
Android网络性能监控方案
Looking for a small immutable dictionary with better performance
Data structure adjacency multiple table (C language implementation)
How long can the flower pig still be fragrant?
Common skills of JS array
用python猜测一个数字是集合里面哪些数字相加求和而来的
Imook nodejs personal learning notes (log)
Mcp4725 driver based on FPGA
彻底深刻理解js原型链之prototype,__proto__以及constructor(二)
The use of Python PIP command
Unity style transfer for person re identification
ASP.NET Core framework revealed