add comment
This commit is contained in:
parent
fe3d826b30
commit
d842060bc4
@ -69,7 +69,6 @@ type Field struct {
|
|||||||
DefaultValueInterface interface{}
|
DefaultValueInterface interface{}
|
||||||
NotNull bool
|
NotNull bool
|
||||||
Unique bool
|
Unique bool
|
||||||
UniqueIndex string
|
|
||||||
Comment string
|
Comment string
|
||||||
Size int
|
Size int
|
||||||
Precision int
|
Precision int
|
||||||
@ -88,6 +87,12 @@ type Field struct {
|
|||||||
Set func(context.Context, reflect.Value, interface{}) error
|
Set func(context.Context, reflect.Value, interface{}) error
|
||||||
Serializer SerializerInterface
|
Serializer SerializerInterface
|
||||||
NewValuePool FieldNewValuePool
|
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 {
|
func (field *Field) BindName() string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user