-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Setup
Versions
- Rust: 1.84.1
- Diesel: 2.2.7
- Database: Postgres 17.1
- Operating System Ubuntu 24.04.1
Feature Flags
- diesel: ["postgres_backend", "postgres", "time", "r2d2", "uuid", "serde_json"]
Problem Description
Similar to #2096
I am however using the schema="name" found in the resolution of that issue as follows
[print_schema.game]
file = "src/diesel_schema/game.rs"
custom_type_derives = ["diesel::query_builder::QueryId", "Clone"]
schema = "game"
[print_schema.people]
file = "src/diesel_schema/people.rs"
custom_type_derives = ["diesel::query_builder::QueryId", "Clone"]
schema = "people"
[migrations_directory]
dir = "./migrations"I also have 2 tables, one in each schema:
CREATE TABLE "people"."api_token"
(
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
val UUID NOT NULL DEFAULT gen_random_uuid()
);CREATE TABLE "game"."game_session"
(
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
api_token_id INTEGER REFERENCES "people"."api_token" (id) NOT NULL -- relation
);The generated diesel schemas do not include the relationship:
pub mod game {
diesel::table! {
game.game_session (id) {
id -> Int4,
api_token_id -> Int4,
}
}
}pub mod people {
diesel::table! {
people.api_token (id) {
id -> Int4,
val -> Uuid,
}
}
}What is the expected output?
one of the schema(game.rs I think?) should include:
diesel::joinable!(game_session -> api_token (api_token_id));
diesel::allow_tables_to_appear_in_same_query!(
api_token,
game_session
}Are you seeing any additional errors?
Yes, cli generate --diff-schema produces empty sql files when I manually add the above lines and then call it.
Steps to reproduce
see above
Checklist
- I have already looked over the issue tracker and the discussion forum for similar possible closed issues.
- This issue can be reproduced on Rust's stable channel. (Your issue will be
closed if this is not the case) - This issue can be reproduced without requiring a third party crate
otakuto