Skip to content

Commit

Permalink
fix tx issue when create node
Browse files Browse the repository at this point in the history
  • Loading branch information
calebx committed Dec 25, 2020
1 parent eaa4b3e commit 0abcbfd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nested_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func Create(db *gorm.DB, source, parent interface{}) error {
return err
}

tx, _, _ := parseNode(db, source)
// UPDATE tree SET lft = lft + 2 WHERE lft > new_lft;
err = tx.Table(tableName).
Where(formatSQL(":lft > ?", target), setToLft).
Expand Down

0 comments on commit 0abcbfd

Please sign in to comment.