From cbebcf6d6fe4961d6f0ce4115f97301a942bd9ce Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Fri, 22 May 2015 11:13:14 +0800 Subject: [PATCH] Quote db name when create primary keys --- scope_private.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope_private.go b/scope_private.go index 4ecefe3a..63fcea46 100644 --- a/scope_private.go +++ b/scope_private.go @@ -475,7 +475,7 @@ func (scope *Scope) createTable() *Scope { } if field.IsPrimaryKey { - primaryKeys = append(primaryKeys, field.DBName) + primaryKeys = append(primaryKeys, scope.Quote(field.DBName)) } scope.createJoinTable(field) }