Set PrimaryField IsBlank to false after read from returning value

This commit is contained in:
Jinzhu 2016-09-13 08:24:29 +08:00
parent 6732a50dfb
commit 3425c1d38d
1 changed files with 1 additions and 0 deletions

View File

@ -118,6 +118,7 @@ func createCallback(scope *Scope) {
} }
} else { } else {
if err := scope.SQLDB().QueryRow(scope.SQL, scope.SQLVars...).Scan(primaryField.Field.Addr().Interface()); scope.Err(err) == nil { if err := scope.SQLDB().QueryRow(scope.SQL, scope.SQLVars...).Scan(primaryField.Field.Addr().Interface()); scope.Err(err) == nil {
primaryField.IsBlank = false
scope.db.RowsAffected = 1 scope.db.RowsAffected = 1
} }
} }