From cd3b11a5031fc00aa1187300d9422e6e01ef619f Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Tue, 22 Mar 2022 23:27:14 +0800 Subject: [PATCH] Fix codegen with Enum in expanded format (#624) --- sea-orm-codegen/src/entity/column.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sea-orm-codegen/src/entity/column.rs b/sea-orm-codegen/src/entity/column.rs index 125e671c..3ba09446 100644 --- a/sea-orm-codegen/src/entity/column.rs +++ b/sea-orm-codegen/src/entity/column.rs @@ -124,6 +124,10 @@ impl Column { let s = s.to_string(); quote! { ColumnType::Custom(#s.to_owned()).def() } } + ColumnType::Enum(enum_name, _) => { + let enum_ident = format_ident!("{}", enum_name.to_camel_case()); + quote! { #enum_ident::db_type() } + } #[allow(unreachable_patterns)] _ => unimplemented!(), };