Skip to content

Commit c833d0f

Browse files
committed
fix
1 parent 775421e commit c833d0f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/unittest/fixtures_loader.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func (f *fixturesLoader) prepareFieldValue(v any) any {
3131
}
3232
return v
3333
}
34+
3435
func (f *fixturesLoader) loadFixtures(file string) error {
3536
data, err := os.ReadFile(file)
3637
if err != nil {
@@ -51,9 +52,9 @@ func (f *fixturesLoader) loadFixtures(file string) error {
5152

5253
switch f.engine.Dialect().URI().DBType {
5354
case schemas.MSSQL:
54-
_, _ = f.engine.Exec("SET IDENTITY_INSERT [%s] ON", tableName)
55+
_, _ = f.engine.Exec(fmt.Sprintf("SET IDENTITY_INSERT `%s` ON", tableName))
5556
defer func() {
56-
_, _ = f.engine.Exec("SET IDENTITY_INSERT [%s] OFF", tableName)
57+
_, _ = f.engine.Exec(fmt.Sprintf("SET IDENTITY_INSERT `%s` OFF", tableName))
5758
}()
5859
}
5960

0 commit comments

Comments
 (0)