Closed pcasa closed 6 years ago
@pcasa uuid is not a solution that will work for everyone since there are some considerations one must make before using uuid as a pk.
If it is something you require, you can easily do that migration yourself without the help of this gem.
If we can generate some new releases, I'm hoping to make this a configurable option, but for now it is outside the scope of this gem.
I was just trying using this gem with uuid
too. I didn't succeed in changing migration files so I tried what you gave us here @pcasa but it does not work.
Did you succeed using thoses changes?
Could help others if readme had some pointers on how to use this gem with UUID's as primary key for associations?
Assumptions, User model has UUID as primary key and using
enable_extension 'pgcrypto'
.Then alter the following migration files: ..._create_friendships.rb > NOTE
t.references :friendable, polymorphic: true, type: :uuid
andt.uuid :friend_id
..._add_blocker_id_to_friendships.rb > NOTE change from
:string
to:uuid