Skip to content

Commit

Permalink
fix: sort relationships by fkey name
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed May 19, 2023
1 parent 296abdf commit 3db6bea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server/templates/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ export interface Database {
relationship.schema === table.schema &&
relationship.relation === table.name
)
.sort(({ foreign_key_name: a }, { foreign_key_name: b }) =>
a.localeCompare(b)
)
.map(
(relationship) => `{
foreignKeyName: ${JSON.stringify(relationship.foreign_key_name)}
Expand Down

0 comments on commit 3db6bea

Please sign in to comment.