In the docs for Ecto Migrations, it has the following description for the validate
option you can pass to references
.
:validate
- Whether or not to validate the foreign key constraint on creation or not. Only available in PostgreSQL, and should be followed by a command to validate the foreign key in a following migration if false.
Does this mean it checks the foreign key constraint on record creation (so every time you make a new row, akin to validate_foreign_constraint() in Changeset?) or on field creation?
Edit: actually now I see that “validate” is set to true on the fk constraint, when I inspect with pgadmin, so I am assuming this act on-insertion and defaults to true, so it acts as you want by default.