-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add support for :binary_id Ecto primary key type #156
Conversation
Btw, this is a revival of #129. |
@tompave hiya! Any chance you had some time to get some 👀 on this? 🙃 |
Hey @whatyouhide , I've had a PR up here for quite some time so until @tompave returns I've created a Hex published fork. You're welcome to raise your pull request there and I'll check it out 🙂 |
@tylerbarker thanks for reaching out, fork_with_flags looks good. I reached out to @tompave on a few platforms, let's see if they get back to me, otherwise yes, we'll consider switching to the fork 🙃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR, and apologies for the long wait.
This should work. Compared to the original PR that you based this on, this relies on Application.compile_env/3
which should make it ok.
I think that the DB migration should also change, though. It cannot be bigserial
in this case.
Documenting it should be enough I reckon. Can you please:
- Explain that the migration needs to be updated in the readme. Add a
h4
section right after "Ecto Multi-tenancy", titled "Ecto custom PK types", or something like that. Move the example that you currently have in the Readme diff to that section, and explain that in order for it to work the DB migration must also be updated (please provide an example for that specific line). - In the migration file, please add a comment with an alternative line for the PK, so that users adopting the package for the first time can easily modify it.
- I pushed some CI and
mix.lock
updates tomaster
. Please merge that in, in order to run CI on the latest.
114cfbd
to
85f418e
Compare
@tompave I did all the stuff you mentioned 🙃, pushed just now. |
Thank you @whatyouhide. I'll get this moving forward this week. |
@tompave okay sounds good. Let me know if I can help, so that we can get this over the finish line and get a release out if possible. Thanks! 🙏 |
It's merged. I want to so some manual tests in a host phoenix app before cutting a release. Just to better understand how UUID PKs behave with FWF, or if it needs some more documentation. |
@tompave sounds good! We're using FWF pretty heavily and have been using this change for a while if it helps. Let me know if I can help with the testing in any case. |
Apologies for the wait. |
Thank you so much @tompave 🙏! |
My awesome coworker @vinniefranco made these changes a while ago: vinniefranco@b432c4e
I updated the README and thought maybe this could make it upstream, and eventually be released 🙃 We've been using this code in production for a good while now. The value could also be
Ecto.UUID
, for example.