mirror of
https://github.com/ent/ent.git
synced 2026-05-04 08:30:57 +03:00
all: fix linting issues before migrating to golangci v1.42 (#2019)
This commit is contained in:
@@ -414,11 +414,8 @@ func (d *Postgres) alterColumn(c *Column) (ops []*sql.ColumnBuilder) {
|
||||
|
||||
// hasUniqueName reports if the index has a unique name in the schema.
|
||||
func hasUniqueName(i *Index) bool {
|
||||
name := i.Name
|
||||
// The "_key" suffix is added by Postgres for implicit indexes.
|
||||
if strings.HasSuffix(name, "_key") {
|
||||
name = strings.TrimSuffix(name, "_key")
|
||||
}
|
||||
// Trim the "_key" suffix if it was added by Postgres for implicit indexes.
|
||||
name := strings.TrimSuffix(i.Name, "_key")
|
||||
suffix := strings.Join(i.columnNames(), "_")
|
||||
if !strings.HasSuffix(name, suffix) {
|
||||
return true // Assume it has a custom storage-key.
|
||||
|
||||
Reference in New Issue
Block a user