Primary key UUID, Diesel only supports tables with primary keys. Table files has no primary key #4625
-
Hi! I would like to use v7 UUIDs as primary keys. Is this possible? This is not working and I can't make much sense of the error. Thanks! schema.rs// @generated automatically by Diesel CLI.
diesel::table! {
files (file_id) {
file_id -> Uuid,
owner_id -> Uuid,
mime_type -> Text,
file_name -> Text,
created_at -> Timestamp,
}
}
diesel::table! {
users (user_id) {
user_id -> Uuid,
external_user_id -> Nullable<Text>,
display_name -> Text,
created_at -> Timestamp,
}
}
cargo.tomldiesel_migrations = "2.2.0"
diesel = { version = "2.2.10", features = [
"chrono",
"uuid",
"postgres_backend",
] }
diesel-async = { version = "0.5.2", features = [
"postgres",
"deadpool",
"async-connection-wrapper",
"r2d2",
] }
tokio-postgres = { version = "0.7.13" } |
Beta Was this translation helpful? Give feedback.
Answered by
firstdorsal
Jun 2, 2025
Replies: 1 comment
-
I figured it out, this was due to invalid state in my development postgres database. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
firstdorsal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I figured it out, this was due to invalid state in my development postgres database.