Refuse an unversioned database that already has a files table (closes #11) #58

Merged
clawbot merged 1 commits from issue-11-unversioned-db-error into next 2026-10-04 12:01:37 +02:00
1 Commits
Author SHA1 Message Date
sneak f6db220c49 Refuse an unversioned database that already has a files table (closes #11)
check / check (push) Failing after 2s
A database at user_version 0 that already has a files table was made
by something else: scan used to run its CREATE TABLE on it and fail
with a raw SQLite error, and report and trees gave only a bare version
mismatch. All three now refuse such a database with the schema-version
error telling the operator to remove the file and rescan. scan creates
the table and index and sets the version in one transaction, so a first
scan stopped partway leaves an empty database the next scan sets up,
never a files table at version 0. A genuinely empty database is
unchanged.

Model: opus-4-8 (implementation); opus-5-5 (rebase)
2026-10-04 09:53:10 +00:00