add comment

This commit is contained in:
black 2023-06-27 19:06:05 +08:00
parent fe3d826b30
commit d842060bc4

View File

@ -69,7 +69,6 @@ type Field struct {
DefaultValueInterface interface{}
NotNull bool
Unique bool
UniqueIndex string
Comment string
Size int
Precision int
@ -88,6 +87,12 @@ type Field struct {
Set func(context.Context, reflect.Value, interface{}) error
Serializer SerializerInterface
NewValuePool FieldNewValuePool
// In some db (e.g. MySQL), Unique and UniqueIndex are indistinguishable.
// When a column has a (not Mul) UniqueIndex, Migrator always reports its gorm.ColumnType is Unique.
// It causes field unnecessarily migration.
// Therefore, we need to record the UniqueIndex on this column (exclude Mul UniqueIndex) for MigrateColumnUnique.
UniqueIndex string
}
func (field *Field) BindName() string {