Skip to content

Commit

Permalink
Merge pull request #484 from k1LoW/sort-functions
Browse files Browse the repository at this point in the history
Sort functions
  • Loading branch information
k1LoW committed Jun 13, 2023
2 parents 5e7398d + 4af3008 commit 06f9f20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (t *Table) ShowColumn(name string, hideColumns []string) bool {
return true
}

// Sort schema tables, columns, relations, and constrains
// Sort schema tables, columns, relations, constrains and functions.
func (s *Schema) Sort() error {
for _, t := range s.Tables {
for _, c := range t.Columns {
Expand Down Expand Up @@ -343,6 +343,9 @@ func (s *Schema) Sort() error {
sort.SliceStable(s.Relations, func(i, j int) bool {
return s.Relations[i].Table.Name < s.Relations[j].Table.Name
})
sort.SliceStable(s.Functions, func(i, j int) bool {
return s.Functions[i].Name < s.Functions[j].Name
})
return nil
}

Expand Down

0 comments on commit 06f9f20

Please sign in to comment.