Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Fix genUpdateColumns() should not ignore soft delete column when unscoped #1051

Merged
merged 1 commit into from
Jul 26, 2018

Conversation

elvinchan
Copy link
Contributor

For example,

type Object struct {
	Id        int64
	DeletedAt time.Time `xorm:"deleted"`
}

Now I want to restore a deleted record, if I use

engine.ID(1).Unscoped().Nullable("deleted_at").Update(&Object{})

It's OK, but if I use

engine.ID(1).Unscoped().Cols("deleted_at").Update(&Object{})

It has no effect.

I think the effect of these two way should be consistent.

@elvinchan elvinchan changed the title Fix genUpdateColumns() should not ignore soft delete column when unsc… Fix genUpdateColumns() should not ignore soft delete column when unscoped Jul 26, 2018
@codecov-io
Copy link

Codecov Report

Merging #1051 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1051      +/-   ##
==========================================
+ Coverage   54.27%   54.31%   +0.03%     
==========================================
  Files          41       41              
  Lines        7551     7551              
==========================================
+ Hits         4098     4101       +3     
+ Misses       2936     2935       -1     
+ Partials      517      515       -2
Impacted Files Coverage Δ
session_update.go 52.54% <100%> (+0.63%) ⬆️
xorm.go 66.15% <0%> (+1.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 545f30f...460c939. Read the comment docs.

@lunny lunny added this to the 0.8 milestone Jul 26, 2018
@lunny lunny merged commit 4b224e8 into go-xorm:master Jul 26, 2018
@lunny
Copy link
Member

lunny commented Jul 26, 2018

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants