-
Notifications
You must be signed in to change notification settings - Fork 41
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
Custom primary keys, it works? #18
Comments
Your example should work, but only because your primary key will be first in Mnesia record (and Mnesia triggers this field as PK). |
Great thanks, and what would be the current limitations / possible issues? |
Actually, I can't even guess :). Looks like it should work, but I have never tried this way. And in nearest future I will work on Ecto integrations tests to merge this PR elixir-ecto/ecto#1865, so can't tell when I will be able to get back to PK's. |
Great ill keep you posted. And that looks awesome :D Great job! |
Thanks for support and testing it :). |
Allright, first issue that pops up during testing, I'm trying to test that the unique constraint is validated correctly. Kinda knew that it wouldn't work but here is the output I receive:
It seems the error message from mnesia is not correctly translated to the upper layers |
@JanStevens Can you give more code so I will be able to reproduce this? In meanwhile I have added new case that test insert with duplicate primary key. |
Can you re-run tests against latest adapter version? |
Hello, Still same issue, I've setup a repo here with a working project (just run the tests): https://github.com/JanStevens/devices_ex |
Hello @AndrewDryga & @JanStevens I'm migrating an app from Amnesia to this library, but have a similar issue. However I cannot update nor delete them. I get this error:
I'm using |
I ran into that same error tonight. The error is being raised here. The The However, even after correcting the error in the source code locally, that didn't fix the error. I ended up needing to switch my options to the following in order to get it to work: @primary_key {:uuid, :binary_id, autogenerate: true} This seems like a bug to me. The code seems to be looking for a field that is autogenerated. Shouldn't the primary key be found with |
@scrogson you are right, I'll fix it in next release. |
Hello,
I see the readme stating that custom primary keys is still a work in progress but I managed to get it to work, my fear is that this is wrong and its not yet fully supported. Whats the current state of it?
Schema
Migration
The text was updated successfully, but these errors were encountered: