defmacro __using__(_) do
quote do
use Ecto.Schema
import Ecto.Changeset, warn: false
import Chapel.Schema, warn: false
import Authority.Ecto.Changeset, warn: false
@primary_key {:id, :binary_id, autogenerate: true} <= Added this line
@foreign_key_type :binary_id <= And this one.
end
end
create table(:users, primary_key: false) do
add :id, :binary_id, primary_key: true
1) test .update_user/2 returns validation errors if passwords don't match (Chapel.AccountsTest)
test/chapel/accounts/accounts_test.exs:111
** (ArgumentError) Postgrex expected an integer in -9223372036854775808..9223372036854775807, got <<159, 219, 108, 216, 200, 157, 78, 176, 171, 158, 70, 159, 199, 95, 205, 234>>. Please make sure the value you are passing matches the definition in your table or in your query or convert the value accordingly.
stacktrace:
(ecto) /home/justin/projects/elixir/chapel/deps/postgrex/lib/postgrex/type_module.ex:715: Ecto.Adapters.Postgres.TypeModule.encode_params/3
(postgrex) lib/postgrex/query.ex:45: DBConnection.Query.Postgrex.Query.encode/3
(db_connection) lib/db_connection.ex:1079: DBConnection.describe_run/5
(db_connection) lib/db_connection.ex:1150: anonymous fn/4 in DBConnection.run_meter/5
(db_connection) lib/db_connection.ex:1207: DBConnection.run_begin/3
(db_connection) lib/db_connection.ex:592: DBConnection.prepare_execute/4
(ecto) lib/ecto/adapters/postgres/connection.ex:86: Ecto.Adapters.Postgres.Connection.execute/4
(ecto) lib/ecto/adapters/sql.ex:256: Ecto.Adapters.SQL.sql_call/6
(ecto) lib/ecto/adapters/sql.ex:542: Ecto.Adapters.SQL.struct/8
(ecto) lib/ecto/repo/schema.ex:547: Ecto.Repo.Schema.apply/4
(ecto) lib/ecto/repo/schema.ex:213: anonymous fn/14 in Ecto.Repo.Schema.do_insert/4
(chapel) test/support/accounts_factory.ex:40: Chapel.AccountsFactory.create_user/1
test/chapel/accounts/accounts_test.exs:1: Chapel.AccountsTest.__ex_unit__/2
PS. I wasn't sure where this issue was best added, happy to move to another repo if needed.