fix: issue #5752 Field should be unique but is not, causing unnecessary ALTER TABLE executions

Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
This commit is contained in:
Hiram Chirino 2023-01-13 18:05:42 -05:00
parent 3d35ddba55
commit 0767b6c506

View File

@ -113,7 +113,7 @@ func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field {
AutoIncrement: utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
HasDefaultValue: utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
NotNull: utils.CheckTruth(tagSetting["NOT NULL"], tagSetting["NOTNULL"]),
Unique: utils.CheckTruth(tagSetting["UNIQUE"]),
Unique: utils.CheckTruth(tagSetting["UNIQUE"], tagSetting["UNIQUEINDEX"]),
Comment: tagSetting["COMMENT"],
AutoIncrementIncrement: 1,
}