all: fix linting issues before migrating to golangci v1.42 (#2019)

This commit is contained in:
Ariel Mashraki
2021-10-07 19:54:43 +03:00
committed by GitHub
parent f5834b6fe6
commit f30a17edd4
2 changed files with 6 additions and 5 deletions

View File

@@ -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.