GORM Playground Link
https://github.com/go-gorm/playground/pull/451
Description
AutoMigrate(PostgreSQL,timestamptz(0)) First OK, but when AutoMigrate Again, while be deadlock.
type User struct{
// ...
Birthday *time.Time `gorm:type:timestamptz(0)"`
// ...
}
func main(){
// ...
if err := DB.Transaction(func(tx *gorm.DB) error {
return tx.AutoMigrate(&User{})
}); err != nil {
t.Error(err)
}
fmt.Println("AutoMigrate(PostgreSQL,timestamptz(0)) First OK, but when AutoMigrate Again, while be deadlock.")
if err := DB.Transaction(func(tx *gorm.DB) error {
return tx.AutoMigrate(&User{})
}); err != nil {
t.Error(err)
}
fmt.Println("Never go to here ...")
// ...
}