It’s possible with approach 1.
as well by providing a custom ecto type for the field
schema "cars" do
field :condition_name, CarCondition
end
The code for CarCondition
would be the same as for an enum except for type/0
callback (:string
instead of enum name), so ecto enum could probably be used as well.