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
It is possible to insert duplicate rsc_id, type and key entries into the identity table #3319
Comments
The problem is that there is no constraint on the |
Maybe just add a constraint and then match on the constraint error? |
I'll first try to catch this in a unit-test. I was thinking about adding the constraint, and put the insertion itself in a transaction. I don't know how postgres will handle this. |
It was possible to catch it in a unit-test. Added the constraint, which is working. I will have to add code to update the schema of an existing database, but... there could be duplicate entries in the table. I'm a bit reluctant to automatically remove double entries. |
Zotonic
version1.0.0-rc.15
OS
/Browser
versionMacOS / Safari
Steps to reproduce
Enter two entries in the identity table with the same rsc_id, type and key in parallel. (I'll try to catch it in a unit-test.)
Current behavior
Two entries are created.
Expected behavior
There should be one entry.
Config
N/A
The text was updated successfully, but these errors were encountered: