@@ -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())
}
@@ -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)