1.Add UniqueIndex field to Field's struct。
2.Resolve UniqueIndex value from StructField.
This commit is contained in:
parent
e0030749b6
commit
2c13ea008e
@ -68,6 +68,7 @@ type Field struct {
|
|||||||
DefaultValue string
|
DefaultValue string
|
||||||
DefaultValueInterface interface{}
|
DefaultValueInterface interface{}
|
||||||
NotNull bool
|
NotNull bool
|
||||||
|
UniqueIndex bool
|
||||||
Unique bool
|
Unique bool
|
||||||
Comment string
|
Comment string
|
||||||
Size int
|
Size int
|
||||||
@ -114,6 +115,7 @@ func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field {
|
|||||||
HasDefaultValue: utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
|
HasDefaultValue: utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
|
||||||
NotNull: utils.CheckTruth(tagSetting["NOT NULL"], tagSetting["NOTNULL"]),
|
NotNull: utils.CheckTruth(tagSetting["NOT NULL"], tagSetting["NOTNULL"]),
|
||||||
Unique: utils.CheckTruth(tagSetting["UNIQUE"]),
|
Unique: utils.CheckTruth(tagSetting["UNIQUE"]),
|
||||||
|
UniqueIndex: utils.CheckTruth(tagSetting["UNIQUEINDEX"]),
|
||||||
Comment: tagSetting["COMMENT"],
|
Comment: tagSetting["COMMENT"],
|
||||||
AutoIncrementIncrement: 1,
|
AutoIncrementIncrement: 1,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user