Properly quotes column names in post-insert SELECT

This commit closes #979 by fixing the post-insert SELECT call
This commit is contained in:
Mark Oberemk 2016-05-02 12:25:04 -04:00
parent 465f8ea05b
commit 3b85ddcc9a
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ func createCallback(scope *Scope) {
if field.IsNormal {
if !field.IsPrimaryKey || !field.IsBlank {
if field.IsBlank && field.HasDefaultValue {
blankColumnsWithDefaultValue = append(blankColumnsWithDefaultValue, field.DBName)
blankColumnsWithDefaultValue = append(blankColumnsWithDefaultValue, scope.Quote(field.DBName))
scope.InstanceSet("gorm:blank_columns_with_default_value", blankColumnsWithDefaultValue)
} else {
columns = append(columns, scope.Quote(field.DBName))