Fix codegen with Enum in expanded format (#624)

This commit is contained in:
Billy Chan 2022-03-22 23:27:14 +08:00 committed by GitHub
parent ec70ed1052
commit cd3b11a503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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!(),
};