Closed
Description
Elixir version
1.18.3
Database and Version
PostgreSQL 15.13
Ecto Versions
3.13.0
Database Adapter and Versions (postgrex, myxql, etc)
postgrex 0.20.0
Current behavior
When running a transaction like
def change do
create table(...) do
...
add :forbidden_times, {:array, {:array, :time}}
timestamps()
end
The migration fails:
10:20:37.992 [info] create table appointment_types
** (MatchError) no match of right hand side value: ["time", "(0)", []]
(ecto_sql 3.13.0) lib/ecto/adapters/postgres/connection.ex:1764: Ecto.Adapters.Postgres.Connection.column_type/2
(ecto_sql 3.13.0) lib/ecto/adapters/postgres/connection.ex:1764: Ecto.Adapters.Postgres.Connection.column_type/2
(ecto_sql 3.13.0) lib/ecto/adapters/postgres/connection.ex:1512: Ecto.Adapters.Postgres.Connection.column_definition/2
(elixir 1.18.3) lib/enum.ex:4500: Enum.map_intersperse_list/3
(elixir 1.18.3) lib/enum.ex:4500: Enum.map_intersperse_list/3
(ecto_sql 3.13.0) lib/ecto/adapters/postgres/connection.ex:1268: Ecto.Adapters.Postgres.Connection.execute_ddl/1
(ecto_sql 3.13.0) lib/ecto/adapters/sql.ex:1217: Ecto.Adapters.SQL.execute_ddl/4
(ecto_sql 3.13.0) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
The bug may be here :
ecto_sql/lib/ecto/adapters/postgres/connection.ex
Lines 1763 to 1771 in 955f0fb
At line 1764, the lib excepts an array of 2 values, but at line 1770, it returns an array of 3 values.
Expected behavior
array of array of time should be handled as before version 3.13.0