fix: clear script database before rebuild to prevent unique constraint violation#3232
Merged
fix: clear script database before rebuild to prevent unique constraint violation#3232
Conversation
…t violations The script store build() replays all records from the record store into SQLite but never cleared the database first. Stale rows from previous builds caused unique constraint violations on the name index when scripts were renamed or recreated.
Contributor
Greptile SummaryFixes the reported bug where stale SQLite rows caused unique constraint violations during script rebuild. The fix correctly clears existing data before replaying records, preventing name conflicts from renamed scripts. The approach is straightforward and solves the problem as described. Important Files Changed
Last reviewed commit: 5fa1fc0 |
pull bot
pushed a commit
to hareki/atuin
that referenced
this pull request
Mar 4, 2026
…t violation (atuinsh#3232) The script store build() replays all records from the record store into SQLite but never cleared the database first. Stale rows from previous builds caused unique constraint violations on the name index when scripts were renamed or recreated. <!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The script store build() replays all records from the record store into SQLite but never cleared the database first. Stale rows from previous builds caused unique constraint violations on the name index when scripts were renamed or recreated.
Checks