Skip to content

Fix cleanup tool to delete chunk payload. - #763

Merged
rusq merged 2 commits into
masterfrom
fix/755-cleanup-orphans
Nov 8, 2026
Merged

rusq merged 2 commits into
masterfrom
fix/755-cleanup-orphans

Conversation

@rusq

@rusq rusq commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Main problem was that foreign keys were not enabled on the connection (by
bootstrap.Database), so the CASCADE never worked. It did not affect other
modes, as they mainly insert the data, and never delete, so CASCADE wasn't
being used and it was never noticed.

The tests did not catch it because they have their own database opener.

Introduced a centralised dsn in the repository (in future, might move it to the
"database driver" package, because it's specific to SQLite, and if Postgress
will going to be added, it will have a different DSN builder).

Fixes #755 .

@rusq rusq added the ai-assisted This PR or Issue were created with the help of AI agent(-s). label Nov 8, 2026
@rusq
rusq merged commit 94cd7d7 into master Nov 8, 2026
4 checks passed
@rusq
rusq deleted the fix/755-cleanup-orphans branch November 8, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted This PR or Issue were created with the help of AI agent(-s).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools cleanup removes SESSION/CHUNK rows but orphans their payload rows (MESSAGE, CHANNEL, FILE, ...)

1 participant