dialect/sql/schema: properly handle indexes of tables with uncountable name (#828)

This commit is contained in:
Ariel Mashraki
2020-10-08 23:24:54 +03:00
committed by GitHub
parent 064c25609b
commit 13b379d07c
24 changed files with 2715 additions and 25 deletions

View File

@@ -100,7 +100,7 @@ func (t *Table) column(name string) (*Column, bool) {
// index returns a table index by its name.
func (t *Table) index(name string) (*Index, bool) {
for _, idx := range t.Indexes {
if idx.Name == name {
if name == idx.Name || name == idx.realname {
return idx, true
}
// Same as below, there are cases where the index name