Compound primary key gives error "Diesel only supports tables with primary keys." #4744
Replies: 2 comments
-
|
I converted this to a discussion as I'm not able to reproduce this locally. Given that it seems like this might be an issue with your local environment instead of an issue in diesel. Diesel uses the following SQL query to load the primary keys for a given table. You can check if that locally returns the expected result: select column_name from information_schema.key_column_usage where constraint_name in (select t.constraint_name from information_schema.table_constraints as t where t.constraint_type = 'PRIMARY KEY') and table_name = 'repo_history_tbl' and table_schema = 'public' order by ordinal_position; |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks yeah this is a weird one. I |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Setup
Versions
Feature Flags
Problem Description
What are you trying to accomplish?
What is the expected output?
What is the actual output?
Are you seeing any additional errors?
Steps to reproduce
Then in
up.sqladd:Then:
$ diesel migration run Diesel only supports tables with primary keys. Table `repo_history_tbl` has no primary keyChecklist
closed if this is not the case)
EDIT: Also tried this approach, which failed with same error:
Beta Was this translation helpful? Give feedback.
All reactions