I have added a unique constraint with the migration below
def up do
create(unique_index(:tbl_wa_acc_details, [:passport_no, :acc_type_id], name: :unique_acc_with_passport)
end
def down do
drop(index(:tbl_wa_acc_details, [:passport_no, :acc_type_id], name: :unique_acc_with_passport))
end
and below is part of the schema
|> multi_validate_format([:mobile, :country_code, :brn_code])
|> unique_constraint([:passport_no, :acc_type_id], name: :unique_acc_with_passport, message: "already exists")
on insert am getting the error
no function clause matching in Ecto.Changeset.add_constraint/6
what Am I doing wrong??