rename variable
This commit is contained in:
parent
08e9ba73a8
commit
4499a24822
@ -56,7 +56,7 @@ type Field struct {
|
||||
BindNames []string
|
||||
DataType DataType
|
||||
GORMDataType DataType
|
||||
CustomDataType DataType
|
||||
IsTaggedType bool
|
||||
PrimaryKey bool
|
||||
AutoIncrement bool
|
||||
AutoIncrementIncrement int64
|
||||
@ -311,7 +311,7 @@ func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field {
|
||||
default:
|
||||
field.DataType = DataType(val)
|
||||
}
|
||||
field.CustomDataType = DataType(val)
|
||||
field.IsTaggedType = true
|
||||
}
|
||||
|
||||
if field.Size == 0 {
|
||||
|
@ -23,9 +23,9 @@ func TestParseCustomTypeSchema(t *testing.T) {
|
||||
}
|
||||
|
||||
fields := []schema.Field{
|
||||
{Name: "Date", DBName: "date", BindNames: []string{"Date"}, DataType: "date", CustomDataType: "date", Tag: `gorm:"type:date"`, TagSettings: map[string]string{"TYPE": "date"}},
|
||||
{Name: "Time", DBName: "time", BindNames: []string{"Time"}, DataType: schema.Time, CustomDataType: "time", Tag: `gorm:"type:time"`, TagSettings: map[string]string{"TYPE": "time"}},
|
||||
{Name: "DateTime", DBName: "date_time", BindNames: []string{"DateTime"}, DataType: schema.Time},
|
||||
{Name: "Date", DBName: "date", BindNames: []string{"Date"}, DataType: "date", IsTaggedType: true, Tag: `gorm:"type:date"`, TagSettings: map[string]string{"TYPE": "date"}},
|
||||
{Name: "Time", DBName: "time", BindNames: []string{"Time"}, DataType: schema.Time, IsTaggedType: true, Tag: `gorm:"type:time"`, TagSettings: map[string]string{"TYPE": "time"}},
|
||||
{Name: "DateTime", DBName: "date_time", BindNames: []string{"DateTime"}, DataType: schema.Time, IsTaggedType: false},
|
||||
}
|
||||
for i := range fields {
|
||||
checkSchemaField(t, product, &fields[i], func(field *schema.Field) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user