Storing enumerated types with Ecto

Is there a best practice for storing an enumerated type in ecto? For example, I want to track the state of an event (queued, processing, completed, failed) (edited)

I would typically have a domain table that would define these states, and use a foreign key relationship so that the parent table would only include the status_id. Is there a better way to approach this problem?

1 Like

maybe this one…


Exactly what I was looking for, thanks!

1 Like