fix: fix type specification for foreign_key_names

This commit is contained in:
Zach Daniel 2023-10-10 15:47:53 -04:00
parent 5805f07d69
commit c6d71d74bf
2 changed files with 70 additions and 70 deletions

View file

@ -1294,9 +1294,3 @@ check_constraint :price, "price_must_be_positive", check: "price > 0", message:
### Introspection
Target: `AshPostgres.CheckConstraint`

View file

@ -335,7 +335,13 @@ defmodule AshPostgres.DataLayer do
"""
],
foreign_key_names: [
type: {:list, {:or, [{:tuple, [:atom, :string]}, {:tuple, [:string, :string]}]}},
type:
{:list,
{:or,
[
{:tuple, [{:or, [:atom, :string]}, :string]},
{:tuple, [{:or, [:atom, :string]}, :string, :string]}
]}},
default: [],
doc: """
A list of foreign keys that could raise errors, or an mfa to a function that takes a changeset and returns a list. In the format: `{:key, "name_of_constraint"}` or `{:key, "name_of_constraint", "custom error message"}`