mirror of
https://github.com/ent/ent.git
synced 2026-05-04 08:30:57 +03:00
dialect/sql/schema: properly handle indexes of tables with uncountable name (#828)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user