Describe the feature

gorm 关联删除目前没有物理删除的选项,存在deleted_at字段的时候,生成的sql是update

Motivation

删除user 并且删除user关联的account 目前写法:

db.Debug().Select("Account").Unscoped().Delete(&user)

执行结果是只物理删除了user表的内容,关联的account里面有deleted_at字段,是update操作。

想增加一个可以选择物理删除关联内容的功能

Related Issues

Comment From: lyn444

This has been done for HasOne and HasMany but not for Many2Many.

could we also add this to case schema.Many2Many

Comment From: lyn444

@jinzhu