From f5a8158506fba4787700af6642ec83d3cd19a71d Mon Sep 17 00:00:00 2001 From: Bent Hillerkus <29630575+benthillerkus@users.noreply.github.com> Date: Wed, 12 Jan 2022 15:58:33 +0100 Subject: [PATCH] Fix the problem thanks to [adwhit/diesel-derive-enum/issues/62#issuecomment-858031613](https://github.com/adwhit/diesel-derive-enum/issues/62#issuecomment-858031613) --- diesel.toml | 2 +- src/schema.rs | 2 +- src/types.rs | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/diesel.toml b/diesel.toml index 0c022d4..2715e03 100644 --- a/diesel.toml +++ b/diesel.toml @@ -3,4 +3,4 @@ [print_schema] file = "src/schema.rs" -import_types = ["diesel::sql_types::*", "crate::types::*"] \ No newline at end of file +import_types = ["diesel::sql_types::*", "crate::types::export*"] \ No newline at end of file diff --git a/src/schema.rs b/src/schema.rs index 75f4b0a..8521aef 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -4,6 +4,6 @@ table! { logs (id) { id -> Int4, - severity -> Level, + severity -> LevelMapping, } } diff --git a/src/types.rs b/src/types.rs index 0ec199c..db80bd3 100644 --- a/src/types.rs +++ b/src/types.rs @@ -8,3 +8,9 @@ pub enum Level { Debug, Trace, } + +pub mod export { + pub use super::*; + + pub use LevelMapping as Level; +} \ No newline at end of file