From 4a03e015f4aa03f599fc554aebbd0bd0041d20a4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 19 Jul 2014 18:02:02 +0800 Subject: [PATCH] bug fixed for log --- engine.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/engine.go b/engine.go index 32924e9a..21e1082e 100644 --- a/engine.go +++ b/engine.go @@ -1070,21 +1070,21 @@ func (engine *Engine) Sync2(beans ...interface{}) error { if engine.dialect.DBType() == core.MYSQL { _, err = engine.Exec(engine.dialect.ModifyColumnSql(table.Name, col)) } else { - engine.LogWarn("Table %s Column %s Old data type is %s, new data type is %s", - table.Name, col.Name, oriCol.SQLType.Name, col.SQLType.Name) + engine.LogWarn(fmt.Sprintf("Table %s Column %s db type is %s, struct type is %s\n", + table.Name, col.Name, oriCol.SQLType.Name, col.SQLType.Name)) } } else { - engine.LogWarn("Table %s Column %s Old data type is %s, new data type is %s", - table.Name, col.Name, oriCol.SQLType.Name, col.SQLType.Name) + engine.LogWarn(fmt.Sprintf("Table %s Column %s db type is %s, struct type is %s", + table.Name, col.Name, oriCol.SQLType.Name, col.SQLType.Name)) } } if col.Default != oriCol.Default { - engine.LogWarn("Table %s Column %s Old default is %s, new default is %s", - table.Name, col.Name, oriCol.Default, col.Default) + engine.LogWarn(fmt.Sprintf("Table %s Column %s db default is %s, struct default is %s", + table.Name, col.Name, oriCol.Default, col.Default)) } if col.Nullable != oriCol.Nullable { - engine.LogWarn("Table %s Column %s Old nullable is %v, new nullable is %v", - table.Name, col.Name, oriCol.Nullable, col.Nullable) + engine.LogWarn(fmt.Sprintf("Table %s Column %s db nullable is %v, struct nullable is %v", + table.Name, col.Name, oriCol.Nullable, col.Nullable)) } } else { session := engine.NewSession()