Hi,
I am trying to dig deeper with Ecto and Postgres at the same time and some of the examples in the Ecto documentation are confusing. For example, I was wondering how I would add column and table constraints in a migration but looking up constraint/2
in Ecto.Migration
wouldn’t tell me. The “Options” section is also confusing:
Options
:check - The expression to evaluate on a row. Required when creating.
:name - The name of the constraint - required.
:name
- as the function has to be called with a name (constraint(table, name, opts \\ [])
) this seems to be redundant and not even used in the examples:exclude
- not mentioned at all yet used in the examples:comment
- only mentioned in the module docs forEcto.Migration
but shouldn’t it be mentioned atconstraint/2
too?
Am I looking at the wrong docs?
Thank you!