Bläddra i källkod

bug fixed for errorf

xormplus 9 år sedan
förälder
incheckning
3636bd63be
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1 1
      engine.go
  2. 1 1
      helpers.go

+ 1 - 1
engine.go

@@ -345,7 +345,7 @@ func (engine *Engine) DBMetas() ([]*core.Table, error) {
 				if col := table.GetColumn(name); col != nil {
 					col.Indexes[index.Name] = index.Type
 				} else {
-					return nil, fmt.Errorf("Unknown col "+name+" in indexes %v of table", index, table.ColumnsSeq())
+					return nil, fmt.Errorf("Unknown col %s in indexe %v of table %v, columns %v", name, index.Name, table.Name, table.ColumnsSeq())
 				}
 			}
 		}

+ 1 - 1
helpers.go

@@ -550,7 +550,7 @@ func genCols(table *core.Table, session *Session, bean interface{}, useCol bool,
 			}
 		}
 
-		if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime && !isZero(fieldValue.Interface()) {
+		if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime && isZero(fieldValue.Interface()) {
 			// if time is non-empty, then set to auto time
 			val, t := session.Engine.NowTime2(col.SQLType.Name)
 			args = append(args, val)