yesodweb / yesodweb/persistent

Postgres migrations should not trigger if the unique key is too long

Open
#1,515 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue Postgres
Dominant language
Haskell
Stars
486
Forks
306
PR merge metrics
No merged PRs in 30d

Description

A table with a long uniqueness key will trigger a migration, but Postgres will silently truncate it to the original length. persistent-postgresql's migrations should truncate the name of a constraint before checking if it needs to be renamed.

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 locating the persistent-postgresql migration code that checks whether constraint names need renaming. Reproduce the case with a uniqueness key longer than PostgreSQL's constraint-name limit, then verify that migration detection matches PostgreSQL's truncated name and no unnecessary migration is triggered.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, postgresql
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.