postgresql - How to use Postgres' enumerated type with Ecto -
with postgresql, can this:
create type order_status enum ('placed','shipping','delivered') from ecto's official doc, there no native type map postgres' enumerated type. module provides custom type enumerated structures, maps integer in database. use library, prefer using native enumerated type ships database.
ecto provides way create custom types, far can see, custom type must map native ecto type...
anyone knows if can done in schema ecto? if yes, how migration work?
ecto_enum supports postgres enum type https://github.com/gjaldon/ecto_enum#using-postgress-enum-type
Comments
Post a Comment