From 5ef368402a665f263b6e7633f9e46bc98fc7a42a Mon Sep 17 00:00:00 2001 From: snoop Date: Wed, 9 Nov 2016 15:58:08 +0900 Subject: [PATCH] rollback --- orm/callback_create.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/orm/callback_create.go b/orm/callback_create.go index b80abe3..c9337d8 100644 --- a/orm/callback_create.go +++ b/orm/callback_create.go @@ -118,18 +118,11 @@ func createCallback(scope *Scope) { } } else { - if scope.Dialect().GetName() == "h2" { - _, err := scope.SQLDB().Exec(scope.SQL, scope.SQLVars...) - if scope.Err(err) == nil { - primaryField.IsBlank = false - scope.db.RowsAffected = 1 - } - } else { - 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 - } - } + 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 + } + } }