Ecto custom type UUID

I have this code that works

embedded_schema do
    field(:id, Ecto.UUID)
end

I am wondering how come this does not work and gives an error invalid or unknown type :uuid for field :id

embedded_schema do
    field(:id, :uuid)
end

Other kinds of field i can do something like field(:name, :string). I was expecting the same here

You can use this:

field :id, :binary_id

Thanks for sharing. Now my doubt is what is the type of the second parameter of field macro? Seems like it can accept atoms as well as modules

It accepts ecto types. The atoms are identifiers for primitive types (listed in Ecto.Schema docs), while modules are for custom Ecto.Type implementations.