I'm trying to build a small app that's going to connect to legacy db. Is there a way to define Ecto model with attribute names different that table columns?
Something like:
schema "oauth_access_tokens" do
field :token
field :user_id, :integer, column: :resource_owner_id
end
Unfortunately, I don't think it's possible right now.
A possible solution is to use views on the database level, but I'm not sure if it's a good idea.