-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL field name used instead of property name in conflictFields #14150
Comments
Also I think #13723 broke something, and now I can't manage default value to behave normally, so that's why I had to set In my model I have primary key |
@allawesome497 are you able to look into this? |
Just saw this - will look into this now.
#13723 shouldn't have touched the logic for determining the default, can you create a small example showing it working in previous versions and what the previous version was? (or if the current example works, just the version where it worked) |
Oh, I'll try to make an example in a few days. |
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
One workaround would be to use |
Issue Creation Checklist
Bug Description
SSCCE
What do you expect to happen?
I expect request like
INSERT INTO "user" ("user_name") VALUES ($1) ON CONFLICT ("user_name") DO UPDATE SET "user_name" = EXCLUDED."user_name" RETURNING "user_name";
What is actually happening?
This one generates request like
ON CONFLICT ("userName") ...
.Additional context
If I use
conflictFields: ["user_name"]
, TypeScript won't compile because it expectsArray<Attributes<User>>
, anduser_name
is not a valid attribute name.Environment
Bug Report Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: