We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da2b3b5 commit ec8ea63Copy full SHA for ec8ea63
1 file changed
lib/ecto/migration.ex
@@ -942,10 +942,15 @@ defmodule Ecto.Migration do
942
defp default_index_name(index) do
943
[index.table, index.columns, "index"]
944
|> List.flatten()
945
- |> Enum.map(&to_string(&1))
946
- |> Enum.map(&String.replace(&1, ~r"[^\w_]", "_"))
947
- |> Enum.map(&String.replace_trailing(&1, "_", ""))
948
- |> Enum.join("_")
+ |> Enum.map_join(
+ "_",
+ fn item ->
+ item
949
+ |> to_string()
950
+ |> String.replace(~r"[^\w]", "_")
951
+ |> String.replace_trailing("_", "")
952
+ end
953
+ )
954
|> String.to_atom()
955
end
956
0 commit comments