恢复软删除的实例

恢复软删除的实例

如果你使用 paranoid:true 软删除了模型的实例,之后想要撤消删除,请使用 restore 方法:

Task.create({ title: 'a task' }).then(task => {
  // 进行软删除...
  return task.destroy();
}).then((task) => {
  // 恢复软删除...
  return task.restore();
})