Composite Primary Keys using Elixir Ecto
Ecto allows us to map a table with composite primary keys into our schemas. The way to do that is by using the primary_key: true
option for the Ecto.Schema.field/3
instead of dealing with the special module attr @primary_key
. Check this out: