Skip to content

Missing Use Case: Composite unique constraints #639

Description

@leio

Sometimes a column needs to be unique only as long as one or more other columns are the same as well.
Often these would be an unique index, e.g. from psql output:
"idx_unique_type_name" UNIQUE, btree (type, name)

The order also matters - in this case the unique index will be usable for WHERE type = ? queries as well, but not WHERE name = ? queries without type filtered as well. This order might want to be different than the order the fields are in the struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-schematoasty-core/src/schema/ — app, db, mappingC-featureA new feature request or missing use case

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions