mirror of
https://github.com/astaxie/beego.git
synced 2024-11-24 06:40:54 +00:00
Fix 4734: we don't need to reset the id to 0
This commit is contained in:
parent
fad897346f
commit
7cdf96d21a
@ -242,14 +242,8 @@ func (o *orm) Update(md interface{}, cols ...string) (int64, error) {
|
|||||||
func (o *orm) Delete(md interface{}, cols ...string) (int64, error) {
|
func (o *orm) Delete(md interface{}, cols ...string) (int64, error) {
|
||||||
mi, ind := o.getMiInd(md, true)
|
mi, ind := o.getMiInd(md, true)
|
||||||
num, err := o.alias.DbBaser.Delete(o.db, mi, ind, o.alias.TZ, cols)
|
num, err := o.alias.DbBaser.Delete(o.db, mi, ind, o.alias.TZ, cols)
|
||||||
if err != nil {
|
|
||||||
return num, err
|
return num, err
|
||||||
}
|
}
|
||||||
if num > 0 {
|
|
||||||
o.setPk(mi, ind, 0)
|
|
||||||
}
|
|
||||||
return num, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// create a models to models queryer
|
// create a models to models queryer
|
||||||
func (o *orm) QueryM2M(md interface{}, name string) QueryM2Mer {
|
func (o *orm) QueryM2M(md interface{}, name string) QueryM2Mer {
|
||||||
|
Loading…
Reference in New Issue
Block a user