@@ -4,11 +4,13 @@ defmodule Ecto.Adapters.SQLite3.DataTypeTest do
44 alias Ecto.Adapters.SQLite3.DataType
55
66 setup do
7+ Application . put_env ( :ecto_sqlite3 , :array_type , :string )
78 Application . put_env ( :ecto_sqlite3 , :binary_id_type , :string )
89 Application . put_env ( :ecto_sqlite3 , :map_type , :string )
910 Application . put_env ( :ecto_sqlite3 , :uuid_type , :string )
1011
1112 on_exit ( fn ->
13+ Application . put_env ( :ecto_sqlite3 , :array_type , :string )
1214 Application . put_env ( :ecto_sqlite3 , :binary_id_type , :string )
1315 Application . put_env ( :ecto_sqlite3 , :map_type , :string )
1416 Application . put_env ( :ecto_sqlite3 , :uuid_type , :string )
@@ -64,12 +66,20 @@ defmodule Ecto.Adapters.SQLite3.DataTypeTest do
6466 assert DataType . column_type ( { :map , % { } } , nil ) == "BLOB"
6567 end
6668
67- test ":array is TEXT" do
69+ test ":array is TEXT or BLOB " do
6870 assert DataType . column_type ( :array , nil ) == "TEXT"
71+
72+ Application . put_env ( :ecto_sqlite3 , :array_type , :binary )
73+
74+ assert DataType . column_type ( :array , nil ) == "BLOB"
6975 end
7076
71- test "{:array, _} is TEXT" do
77+ test "{:array, _} is TEXT or BLOB " do
7278 assert DataType . column_type ( { :array , [ ] } , nil ) == "TEXT"
79+
80+ Application . put_env ( :ecto_sqlite3 , :array_type , :binary )
81+
82+ assert DataType . column_type ( { :array , [ ] } , nil ) == "BLOB"
7383 end
7484
7585 test ":float is NUMERIC" do
0 commit comments