From a1c5b721e16f72dcb7d2e3a1a8209258759e7668 Mon Sep 17 00:00:00 2001 From: Dmitry Koudryavtsev Date: Thu, 26 Dec 2024 14:56:02 +0300 Subject: [PATCH] Fix enum values ordering (#138) --- src/postgres/query/enumeration.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/postgres/query/enumeration.rs b/src/postgres/query/enumeration.rs index 043edf10..415531d2 100644 --- a/src/postgres/query/enumeration.rs +++ b/src/postgres/query/enumeration.rs @@ -20,6 +20,8 @@ pub enum PgEnum { EnumLabel, #[iden = "enumtypid"] EnumTypeId, + #[iden = "enumsortorder"] + EnumSortOrder, } #[derive(Debug, Default)] @@ -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() }