apply EnumValues to mapped column

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
This commit is contained in:
Shlomi Noach 2021-05-02 20:56:02 +03:00
parent e80ddb42c9
commit 6e5b665c55
2 changed files with 5 additions and 0 deletions

View File

@ -189,6 +189,7 @@ func (this *Inspector) inspectOriginalAndGhostTables() (err error) {
}
if column.Name == mappedColumn.Name && column.Type == sql.EnumColumnType && mappedColumn.Charset != "" {
this.migrationContext.MappedSharedColumns.SetEnumToTextConversion(column.Name)
this.migrationContext.MappedSharedColumns.SetEnumValues(column.Name, column.EnumValues)
}
}

View File

@ -189,6 +189,10 @@ func (this *ColumnList) IsEnumToTextConversion(columnName string) bool {
return this.GetColumn(columnName).enumToTextConversion
}
func (this *ColumnList) SetEnumValues(columnName string, enumValues string) {
this.GetColumn(columnName).EnumValues = enumValues
func (this *ColumnList) String() string {
return strings.Join(this.Names(), ",")
}