yesodweb / yesodweb/persistent

Custom Primary keys not listed in `persistUniqueKeys`

Open
#1,090 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
486
Forks
306
PR merge metrics
No merged PRs in 30d

Description

When specifying a custom Primary in persistent-template, the field is set as unique in the database. However this field is not listed in persistUniqueKeys, so various operations involving uniqueness ignore it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how persistent-template handles custom Primary fields and assembles persistUniqueKeys. Compare the database uniqueness metadata with the generated key list and inspect any existing uniqueness tests. Done means a custom Primary appears in persistUniqueKeys and uniqueness-related operations account for it.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.