This tag does not work with postgresql when Automigrate. sql:"type:enum('owner', 'write', 'read');"

but mysql worked.

  • postgresql version: 9.6.8
  • gorm: v1.9.1
// example
type User struct {
    ID       int    `json:"id" gorm:"primary_key"`
    Role     string `json:"role" sql:"type:enum('owner', 'write', 'read');"`
}

Comment From: dangkaka

hi @locona, what was wrong? I'm having the same issue

Comment From: shafy

Me too, same issue

Comment From: qshuai

Please mysql usage: https://github.com/jinzhu/gorm/issues/1978#issuecomment-421919405

Comment From: jyono

Why is this closed? it seems like it still doesn't work.