Use integers or enum to represent attoms in AshPostgres

The best way to do it currently would be to use an enum type. You’d create the enum type in postgres yourself, and then override it using migration_types.

postgres do
  ...
  migration_types your_field: :the_enum_type_name
end

Then you’d use an Ash enum type, like so

defmodule YourEnum do
  use Ash.Type.Enum, values: [:foo, :bar, :baz]
end
1 Like