Using a primary key not named id with Ecto and Mysql


You would like to use a legacy or a database you don’t have control over, with Phoenix, but the primary key of the table it is not named ‘id’.


You can define the primary key using the @primary_key as in:

Taken from here