yesodweb / yesodweb/persistent

Sqlite Ids are not AUTOINCREMENT

Open
#1,598 0 comments 0 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

Sqlite requires AUTOINCREMENT to prevent reuse of ROWIDs
https://www.sqlite.org/autoinc.html

This has caused bugs for me in the past but I never noticed that that was the reason until I looked at the migrations being generated.

A regression test would add a row, delete it, and add another. The id of the newest row should be 2, not 1.

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

No file or test path is named. Start by locating the SQLite migration or schema-generation entry point and existing SQLite regression tests, then cover the described insert-delete-insert case. Done means the first row receives ID 1 and the replacement row receives ID 2.

Written by the indexing model from the issue text.

Assessment

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