We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gorm 关联删除目前没有物理删除的选项,存在deleted_at字段的时候,生成的sql是update
删除user 并且删除user关联的account 目前写法:
db.Debug().Select("Account").Unscoped().Delete(&user)
执行结果是只物理删除了user表的内容,关联的account里面有deleted_at字段,是update操作。
想增加一个可以选择物理删除关联内容的功能
The text was updated successfully, but these errors were encountered:
883c32e
Support Unscoped when delete with selected associations, close go-gor…
f0ff7b8
…m#4062
977dd75
This has been done for HasOne and HasMany but not for Many2Many.
could we also add this to case schema.Many2Many
Sorry, something went wrong.
@jinzhu
jinzhu
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: