From 6e5b665c557e2aa4c1456410a0f231022f950966 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 2 May 2021 20:56:02 +0300 Subject: [PATCH] apply EnumValues to mapped column Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/logic/inspect.go | 1 + go/sql/types.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/go/logic/inspect.go b/go/logic/inspect.go index 7b8002d..6c873c8 100644 --- a/go/logic/inspect.go +++ b/go/logic/inspect.go @@ -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) } } diff --git a/go/sql/types.go b/go/sql/types.go index 44e9725..c4be371 100644 --- a/go/sql/types.go +++ b/go/sql/types.go @@ -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(), ",") }