Skip to content

Commit cd471c3

Browse files
committed
fixing gorm model
1 parent 0cb791c commit cd471c3

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

configs/gorm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
type Base struct {
1212
ID string `gorm:"primaryKey;autoIncrement:false"`
13-
Counter uint64 `gorm:"primaryKey;autoIncrement:true"`
13+
Counter uint64 `gorm:"index;autoIncrement:true"`
1414
CreatedAt sql.NullTime
1515
UpdatedAt sql.NullTime
1616
CreatedBy sql.NullString

generators/templates/model.tpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
package models
22

33
import (
4-
"database/sql"
5-
"time"
6-
74
configs "{{.PackageName}}/configs"
8-
"gorm.io/gorm"
95
)
106

117
type {{.Module}} struct {

0 commit comments

Comments
 (0)