@@ -1395,9 +1395,7 @@ defmodule Ecto.Migration do
13951395 defp validate_type! ( type ) when is_atom ( type ) do
13961396 case Atom . to_string ( type ) do
13971397 "Elixir." <> _ ->
1398- raise ArgumentError ,
1399- "#{ inspect type } is not a valid database type, " <>
1400- "please use an atom like :string, :text and so on"
1398+ raise_invalid_migration_type! ( type )
14011399 _ ->
14021400 :ok
14031401 end
@@ -1416,17 +1414,23 @@ defmodule Ecto.Migration do
14161414 end
14171415
14181416 defp validate_type! ( type ) do
1417+ raise_invalid_migration_type! ( type )
1418+ end
1419+
1420+ defp raise_invalid_migration_type! ( type ) do
14191421 raise ArgumentError , """
14201422 invalid migration type: #{ inspect ( type ) } . Expected one of:
14211423
14221424 * an atom, such as :string
14231425 * a quoted atom, such as :"integer unsigned"
1424- * an Ecto.Type, such as Ecto.UUID
1425- * a tuple of the above, such as {:array, :integer} or {:array, Ecto.UUID}
1426+ * a tuple representing a composite type, such as {:array, :integer} or {:map, :string}
14261427 * a reference, such as references(:users)
14271428
1428- All Ecto types are allowed and properly translated.
1429- All other types are sent to the database as is.
1429+ Ecto types are automatically translated to database types. All other types
1430+ are sent to the database as is.
1431+
1432+ Types defined through Ecto.Type or Ecto.ParameterizedType aren't allowed,
1433+ use their underlying types instead.
14301434 """
14311435 end
14321436
0 commit comments