1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 23:40:56 +00:00

fix the sqlite m2m

This commit is contained in:
astaxie 2016-01-14 23:49:28 +08:00
parent 0eaf923a27
commit 4375ca84d1

View File

@ -14,9 +14,7 @@
package orm package orm
import ( import "reflect"
"reflect"
)
// model to model struct // model to model struct
type queryM2M struct { type queryM2M struct {
@ -48,7 +46,8 @@ func (o *queryM2M) Add(mds ...interface{}) (int64, error) {
var other_names []string var other_names []string
for _, colname := range mi.fields.dbcols { for _, colname := range mi.fields.dbcols {
if colname != mfi.column && colname != rfi.column && colname != fi.mi.fields.pk.column { if colname != mfi.column && colname != rfi.column && colname != fi.mi.fields.pk.column &&
mi.fields.columns[colname] != mi.fields.pk {
other_names = append(other_names, colname) other_names = append(other_names, colname)
} }
} }