Skip to content
New issue

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

关联删除对象不支持物理删除选项 #4062

Closed
goguanli opened this issue Feb 6, 2021 · 2 comments
Closed

关联删除对象不支持物理删除选项 #4062

goguanli opened this issue Feb 6, 2021 · 2 comments
Assignees
Labels
type:feature_request feature request

Comments

@goguanli
Copy link

goguanli commented Feb 6, 2021

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

@lyn444
Copy link

lyn444 commented May 16, 2022

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

could we also add this to case schema.Many2Many

@lyn444
Copy link

lyn444 commented May 16, 2022

@jinzhu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature_request feature request
Projects
None yet
Development

No branches or pull requests

3 participants