prorm API Reference
    Preparing search index...

    Enumeration ConstraintType

    A table constraint.

    Two conflicting definitions of this existed — models/constraints.ts included EXCLUDE, models/indexes.ts did not — so which members were legal depended on which module you imported the type from. This is the union of both.

    Index
    PrimaryKey: "PRIMARY KEY"

    The row's identity. At most one per table, and never null.

    Unique: "UNIQUE"

    No two rows share these values. Nulls are exempt on most engines.

    ForeignKey: "FOREIGN KEY"

    The value must exist in another table. See ReferentialAction.

    Check: "CHECK"

    A predicate every row must satisfy.

    Exclude: "EXCLUDE"

    No two rows may overlap on the given operators — the general form of UNIQUE, used for things like non-overlapping date ranges.

    PostgreSQL only. Fields on engines without it take TableConstraintTypeLike, which omits this member.