Closed andrewtimberlake closed 2 months ago
hi! thanks for taking the time to contribute. i'll need a moment to review this more thoroughly but i did have some immediate feedback for you:
2. You can’t set the foreign key type aside from using
@foreign_key_type TypeID
you can do this using define_field: false
on the belongs_to
and defining the foreign key field manually. See https://github.com/sloanelybutsurely/typeid-elixir/issues/20#issuecomment-1635829743 for a more complete example.
I was trying to migrate from bigint ids to TypeID I came across a few problems because I need to have TypeID working during interim steps.
You can’t use TypeID as a standard, non primary-key field (this would fail to pick up the prefix)
You can’t set the foreign key type aside from using
@foreign_key_type TypeID
This pull request addresses both usages I didn’t see any Ecto tests, so I haven’t provided tests.