yesodweb / yesodweb/persistent
Postgres migrations should not trigger if the unique key is too long
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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