From 1ab07b596743a8b1bc5f9f3a542a9ddb3353f57f Mon Sep 17 00:00:00 2001 From: Pmarquez <48651252+pxp9@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:53:20 +0200 Subject: [PATCH] fix diesel setup commented in README (#131) --- Makefile | 2 +- fang/src/blocking/schema.rs | 6 +++--- fang/src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f955856a..ec8c2e8c 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ db: clippy: cargo clippy --all-features diesel: - DATABASE_URL=postgres://postgres:postgres@localhost/fang diesel migration run + cd fang && DATABASE_URL=postgres://postgres:postgres@localhost/fang diesel migration run stop: docker kill postgres tests: diff --git a/fang/src/blocking/schema.rs b/fang/src/blocking/schema.rs index bdc2ed7b..4f9dff21 100644 --- a/fang/src/blocking/schema.rs +++ b/fang/src/blocking/schema.rs @@ -3,18 +3,18 @@ pub mod sql_types { #[derive(diesel::sql_types::SqlType)] #[diesel(postgres_type(name = "fang_task_state"))] - pub struct FangTaskStateEnum; + pub struct FangTaskState; } diesel::table! { use diesel::sql_types::*; - use super::sql_types::FangTaskStateEnum; + use super::sql_types::FangTaskState; fang_tasks (id) { id -> Uuid, metadata -> Jsonb, error_message -> Nullable, - state -> FangTaskStateEnum, + state -> FangTaskState, task_type -> Varchar, uniq_hash -> Nullable, retries -> Int4, diff --git a/fang/src/lib.rs b/fang/src/lib.rs index d46917ef..f5047d91 100644 --- a/fang/src/lib.rs +++ b/fang/src/lib.rs @@ -108,7 +108,7 @@ pub struct FangError { #[cfg_attr(feature = "asynk", postgres(name = "fang_task_state"))] #[cfg_attr( feature = "blocking", - ExistingTypePath = "crate::schema::sql_types::FangTaskStateEnum" + ExistingTypePath = "crate::schema::sql_types::FangTaskState" )] pub enum FangTaskState { /// The task is ready to be executed