From 10cba1556b770ac1f19d4b0156f9f0bfb1f6ea79 Mon Sep 17 00:00:00 2001 From: biju-kalissery Date: Tue, 8 Sep 2015 14:06:45 -0400 Subject: [PATCH] enable identity column insert optionally for mssql ref: https://github.com/jinzhu/gorm/issues/647 --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 657342e9..286b7f51 100644 --- a/main.go +++ b/main.go @@ -451,6 +451,7 @@ func (s *DB) CurrentDatabase() string { return name } + /* Add foreign key to the given scope @@ -550,3 +551,7 @@ func (s *DB) GetErrors() (errors []error) { } return } + +func (s *DB) EnableIdentityInsert(db *DB, tableName string) *DB { + return s.dialect.EnableIdentityInsert(db, tableName) +}