Skip to content

Commit

Permalink
ci: delete unused function, appease lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
bevzzz committed Nov 8, 2024
1 parent 42fdced commit da0d8e3
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions migrate/diff.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package migrate

import (
"fmt"
"strings"

"github.com/uptrace/bun/migrate/sqlschema"
"github.com/uptrace/bun/schema"
)
Expand Down Expand Up @@ -230,10 +227,10 @@ func newDetector(got, want sqlschema.Schema, opts ...diffOption) *detector {
}

return &detector{
current: got,
target: want,
refMap: newRefMap(got.GetForeignKeys()),
eqType: cfg.EqType,
current: got,
target: want,
refMap: newRefMap(got.GetForeignKeys()),
eqType: cfg.EqType,
}
}

Expand All @@ -247,7 +244,7 @@ func withTypeEquivalenceFunc(f TypeEquivalenceFunc) diffOption {

// detectorConfig controls how differences in the model states are resolved.
type detectorConfig struct {
EqType TypeEquivalenceFunc
EqType TypeEquivalenceFunc
}

// detector may modify the passed database schemas, so it isn't safe to re-use them.
Expand Down Expand Up @@ -314,12 +311,6 @@ func (d *detector) mapNameToColumn(t sqlschema.Table) map[string]sqlschema.Colum
return m
}

// defaultFKName returns a name for the FK constraint in the format {tablename}_{columnname(s)}_fkey, following the Postgres convention.
func defaultFKName(fk sqlschema.ForeignKey) string {
columnnames := strings.Join(fk.From.Column.Split(), "_")
return fmt.Sprintf("%s_%s_fkey", fk.From.FQN.Table, columnnames)
}

type TypeEquivalenceFunc func(sqlschema.Column, sqlschema.Column) bool

// equalSignatures determines if two tables have the same "signature".
Expand Down

0 comments on commit da0d8e3

Please sign in to comment.