Open ilyadh opened 11 months ago
I'm using gorm.io/gen to generate models from schema. Driver update from v1.5.3 to v1.5.4 changed the way default value for jsonb is generated.
// v1.5.3 type MyModel struct { Data datatypes.JSON `gorm:"column:data;type:jsonb;default:'{}'" json:"data"` } // v1.5.4 type MyModel struct { Data datatypes.JSON `gorm:"column:data;type:jsonb;default:{}" json:"data"` }
(datatypes.JSON is my customization with DataTypeMap)
Now when running AutoMigrate I get the following error:
AutoMigrate
Error migrating the database: ERROR: syntax error at or near "{" (SQLSTATE 42601)
Description
I'm using gorm.io/gen to generate models from schema. Driver update from v1.5.3 to v1.5.4 changed the way default value for jsonb is generated.
(datatypes.JSON is my customization with DataTypeMap)
Now when running
AutoMigrate
I get the following error: