-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres: AutoMigrate not stable for type:varchar;default:''
#6543
Comments
@jinzhu PTAL at this issue with a reproduction. Also, not sure if that's the issue, but on debugging I noticed in (migrator/migrator.go)[https://github.com/go-gorm/gorm/blob/master/migrator/migrator.go#L439C25-L439C25] that the default from the DB is read as |
type:varchar;default:''
Thanks @jinzhu! much appreciated. |
Doesn't it loose the default value? I've also found this issue but in case of model generation. If the text field has the empty string as default value it generates model with following tag: |
GORM Playground Link
go-gorm/playground#644
Description
Every time we run AutoMigrage we get the same
Even thought the column definition is already correct. We currently cannot ignore this as we generate migration files for every PR that changes the schema. Also no known workaround.
The text was updated successfully, but these errors were encountered: