Skip to content

Commit

Permalink
Fix enum values ordering (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDIM47 authored Dec 26, 2024
1 parent cf94ae9 commit a1c5b72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/postgres/query/enumeration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub enum PgEnum {
EnumLabel,
#[iden = "enumtypid"]
EnumTypeId,
#[iden = "enumsortorder"]
EnumSortOrder,
}

#[derive(Debug, Default)]
Expand All @@ -39,6 +41,7 @@ impl SchemaQueryBuilder {
Expr::col((PgEnum::Table, PgEnum::EnumTypeId)).equals((PgType::Table, PgType::Oid)),
)
.order_by((PgType::Table, PgType::TypeName), Order::Asc)
.order_by((PgEnum::Table, PgEnum::EnumSortOrder), Order::Asc)
.order_by((PgEnum::Table, PgEnum::EnumLabel), Order::Asc)
.take()
}
Expand Down

0 comments on commit a1c5b72

Please sign in to comment.