Skip to content

Commit

Permalink
fix(typegen): view relationships ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Oct 19, 2024
1 parent 2e54f31 commit 3956d43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/templates/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,10 @@ export type Database = {
relationship.referenced_schema === view.schema &&
relationship.relation === view.name
)
.sort(({ foreign_key_name: a }, { foreign_key_name: b }) =>
a.localeCompare(b)
.sort(
(a, b) =>
a.foreign_key_name.localeCompare(b.foreign_key_name) ||
a.referenced_relation.localeCompare(b.referenced_relation)
)
.map(
(relationship) => `{
Expand Down

0 comments on commit 3956d43

Please sign in to comment.