Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ func TestGORM(t *testing.T) {
t.Errorf("Failed, got error: %v", err)
}
}
func TestAutoMigrateDecimal(t *testing.T) {
err := DB.AutoMigrate(Change{})
if err != nil {
t.Fatal(err.Error())
}
err = DB.AutoMigrate(Change{})
if err != nil {
t.Fatal(err.Error())
}
}
4 changes: 4 additions & 0 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ type Language struct {
Code string `gorm:"primarykey"`
Name string
}

type Change struct {
RecID int64 `gorm:"column:recid;type:decimal(9,0);not null;autoIncrement:false" json:"recid"`
}
Loading