Restoring soft-deleted instances
If you have soft-deleted an instance of a model with paranoid: true
, and would like to undo the deletion, use the restore
method:
Task.create({ title: 'a task' }).then(task => {
// now you see me...
return task.destroy();
}).then((task) => {
// now i'm gone, but wait...
return task.restore();
})