Skip to content

Commit

Permalink
fix diesel setup commented in README (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
pxp9 authored Aug 14, 2023
1 parent 3022608 commit 1ab07b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions fang/src/blocking/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Text>,
state -> FangTaskStateEnum,
state -> FangTaskState,
task_type -> Varchar,
uniq_hash -> Nullable<Bpchar>,
retries -> Int4,
Expand Down
2 changes: 1 addition & 1 deletion fang/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ab07b5

Please sign in to comment.