Merge 6c19f3ac0fbb8825081ea1ea37ebe5799e99696c into 4e34a6d21b63e9a9b701a70be9759e5539bf26e9

This commit is contained in:
JackAi 2025-08-21 10:15:15 +08:00 committed by GitHub
commit 7678b52925
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -553,7 +553,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy
} else if currentDefaultNotNull || dvNotNull {
switch field.GORMDataType {
case schema.Time:
if !strings.EqualFold(strings.TrimSuffix(dv, "()"), strings.TrimSuffix(field.DefaultValue, "()")) {
if !strings.EqualFold(strings.Split(dv, "(")[0], strings.Split(field.DefaultValue, "(")[0]) {
alterColumn = true
}
case schema.Bool: