Skip to content

Commit 76f81b7

Browse files
committed
Fix deep nesting issue
1 parent 13940d4 commit 76f81b7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/ecto/adapters/sqlite3/connection.ex

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,14 @@ defmodule Ecto.Adapters.SQLite3.Connection do
113113
constraint
114114
|> String.split(", ")
115115
|> Enum.with_index()
116-
|> Enum.map(fn {table_col, idx} ->
117-
case idx do
118-
0 -> table_col |> String.replace(".", "_")
119-
_ -> table_col |> String.split(".") |> List.last()
120-
end
116+
|> Enum.map(fn
117+
{table_col, 0} ->
118+
String.replace(table_col, ".", "_")
119+
120+
{table_col, _} ->
121+
table_col
122+
|> String.split(".")
123+
|> List.last()
121124
end)
122125
|> Enum.concat(["index"])
123126
|> Enum.join("_")

0 commit comments

Comments
 (0)