Questions tagged [soft-delete]

Soft delete is to delete data from database in a way in which it can be recovered in the future rather than permanently deleting the data,

Soft delete, in database terminology, means to delete data from a database by generally marking it with flag like isDeleted rather than permanently deleting data. Soft delete helps in preserving data such that it can be recovered in the future rather than actually deleting it. Soft deleting also prevents accidental data losses.

367 questions
6
votes
4 answers

mongoose Soft delete using object ID

So I am trying to use mongoose-delete plugin to soft delete data in mongoDB, but the request has only got the object ID for the mongoose object. So in order to "soft-delete" the data, I am having to first do a findOne, and then use the delete…
akash kariwal
  • 81
  • 1
  • 1
  • 6
6
votes
1 answer

Soft delete with @MappedSuperClass in Hibernate

I have an abstract base class A, which is a @MappedSuperClass. Also, there are several entity classes which extend from class A. Class A contains an attribute called STATUS, which represents whether a record is deleted or not.…
uguurozkan
  • 321
  • 1
  • 3
  • 15
6
votes
1 answer

Entity Framework 6 Disable Interception temporarily

I am using an IDbCommandTreeInterceptor to enable soft deletes on my model. System.Data.Entity.Infrastructure.Interception.DbInterception.Add( new SoftDeleteInterception()); I want to be able to disable the interceptor temporarily so that I…
MrZander
  • 3,031
  • 1
  • 26
  • 50
6
votes
1 answer

How do I Cascade a SoftDelete?

After checking these SO articles: cascade-delete-in-entity-framework, ef6-1-soft-delete-with-cascade-delete, cascading-soft-delete, method-for-cascading-soft-deletes-in-parent-child-relationships and reasons-for-cascading-soft-deletes and not…
Randy
  • 1,137
  • 16
  • 49
6
votes
1 answer

Doctrine SoftDelete OneToOne Relationship

I have these entities on my code. class Review extends BaseEntity { /** @ORM\OneToOne(targetEntity="Action", mappedBy="review") */ protected $action; } class Action extends BaseEntity { /** @ORM\OneToOne(targetEntity="Review",…
richardalberto
  • 515
  • 2
  • 9
  • 23
6
votes
2 answers

Symfony2 SoftDeleteable not working on QueryBuilder Delete

Softdelete behavior works fine on execute delete statement via the entity manager as the following code: $entity = $this->em->getRepository('Users')->find(7); $this->em->remove($entity); $this->em->flush(); but when execute the same functionality…
HMagdy
  • 3,029
  • 33
  • 54
6
votes
5 answers

PHP Doctrine SoftDelete - Include deleted records?

If I have one of my PHP Doctrine objects act as a SoftDelete, is it possible to include deleted items in the results of certain queries? What I'm looking for is something like this... $q = Doctrine_Query::create() ->select('*') ->from('Test…
Wickethewok
  • 6,534
  • 11
  • 42
  • 40
6
votes
1 answer

Getting paranoia deleted objects through polymorphic relation in Rails 3

I have an Audit class which is used to store action, by and on attributes. class Audit < ActiveRecord::Base attr_accessible :activity belongs_to :by, :polymorphic => true belongs_to :on, :polymorphic => true attr_accessible :by, :on end The…
zmalex
  • 115
  • 1
  • 6
5
votes
1 answer

How to apply soft delete filter in MongoDB Driver for C#?

public class User { public string Id { get; private set; } public string Name { get; private set;} public bool IsActive{ get; private set; } } I am building a .Net application using MongoDB Driver to connect to Mongo. Some…
5
votes
5 answers

Is there a better version of something like acts_as_paranoid for Rails 3?

Does anyone know of a gem that both soft deletes records from a database (just flags them as deleted as opposed to is actually deleted) and... ...also when do you any type of find automatically omits those trashed records without using any special…
CafeHey
  • 5,699
  • 19
  • 82
  • 145
5
votes
1 answer

Hibernate: Overwrite sql-delete with inheritace

I have an entity A and B extends A and try to have a soft-delete with joined inheritance strategy. @Entity @Inheritance(strategy = InheritanceType.JOINED) @SQLDelete("UPDATE A SET deleted = 1 WHERE id = ?") A { @Id long id; boolean…
Jan
  • 1,594
  • 1
  • 20
  • 30
5
votes
2 answers

Django, cascading move to a separate table instead of cascading delete

I'd like to keep data when we delete instead of soft-delete (which uses is_deleted field), I'd like to move the data to another table (for deleted rows) https://stackoverflow.com/a/26125927/433570 I don't know what is the name of the strategy…
eugene
  • 39,839
  • 68
  • 255
  • 489
5
votes
2 answers

Soft delete in Sails/Waterline

Trying to delete a user model using: //Hard Delete User.destroy({id:userId}, function(err, res){ //Hard Delete }) I need to do a soft delete on User model and currently setting a flag isDeleted to true on delete and updating…
Abhishek
  • 1,999
  • 5
  • 26
  • 52
5
votes
1 answer

Why is Laravel trashed() method not found>

I'm trying to use the soft delete functionality of Elequent ORM in Laravel 4.1 Deleting records works as expected, however when I search for results using withTrashed() and then check to see if it was a soft deleted record using trashed() I get the…
user1462432
  • 233
  • 3
  • 9
4
votes
1 answer

How to tell terraform it should try to delete a soft-deleted azure keyvault key, when it exists?

Azure enforces purge protection on all keyvault keys by default and this is causing some headaches when using terraform. Specicially this can run into a situation where you deleted a VM using a disk-encryption key and as a result, terraform deleted…
Db0
  • 151
  • 2
  • 10
1 2
3
24 25