Use the new Enum type in Ecto 3.5
Enums are a great way to safely store user roles, record status updates, and many other things in your database. Ecto 3.5 added Ecto.Enum which makes it easier than ever to persist enums to your database.
https://dennisbeatty.com/use-the-new-enum-type-in-ecto-3-5.html
Read next Mutiny: Simple database immutability