You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a field in a database table uses the serializer tag and AutoMigrate is used, then even if there are no changes to this field, AutoMigrate will still perform an ALTER on the table every time #7590
If a field in a database table uses the serializer tag and AutoMigrate is used, then even if there are no changes to this field,AutoMigrate will still perform an ALTER on the table every time.
The reason is that during the AutoMigrate comparison, the default value read from the database does not match the default value bound by GORM. The dv variable is read from the database, while field.DefaultValue is obtained by GORM after reading the struct. field.DefaultValue includes an extra layer of single quotes (''), causing the values to not match.