initSchema (db.go:163-166) treats user_version == 0 as "empty database" and calls createSchema, which unconditionally runs CREATE TABLE files (db.go:176-191). If the database already has a files table but user_version is 0 — a database created by some other tool, a partially initialized file, or one whose user_version was reset — the user gets create schema: table files already exists, which explains nothing and suggests no action.
README §Database says a database whose schema version is not 1 is a fatal error, so the intended behaviour for an unrecognized database is a clear schema-version error, not a raw SQLite complaint.
Definition of done
initSchema distinguishes a genuinely empty database from one that has a files table but no recognized version, and reports the latter with a clear fatal error naming the file and telling the operator to remove it and rescan.
Alternatively createSchema uses CREATE TABLE IF NOT EXISTS — but only if the version is then still validated, so an unversioned foreign database is not silently adopted.
A test creates a database with a bare files table and user_version = 0 and asserts the error message.
make check green.
`initSchema` (`db.go:163-166`) treats `user_version == 0` as "empty database" and calls `createSchema`, which unconditionally runs `CREATE TABLE files` (`db.go:176-191`). If the database already has a `files` table but `user_version` is 0 — a database created by some other tool, a partially initialized file, or one whose `user_version` was reset — the user gets `create schema: table files already exists`, which explains nothing and suggests no action.
README §Database says a database whose schema version is not 1 is a fatal error, so the intended behaviour for an unrecognized database is a clear schema-version error, not a raw SQLite complaint.
## Definition of done
1. `initSchema` distinguishes a genuinely empty database from one that has a `files` table but no recognized version, and reports the latter with a clear fatal error naming the file and telling the operator to remove it and rescan.
2. Alternatively `createSchema` uses `CREATE TABLE IF NOT EXISTS` — but only if the version is then still validated, so an unversioned foreign database is not silently adopted.
3. A test creates a database with a bare `files` table and `user_version = 0` and asserts the error message.
4. `make check` green.
clawbot
added this to the 1.0.0 milestone 2026-08-09 03:45:01 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
initSchema(db.go:163-166) treatsuser_version == 0as "empty database" and callscreateSchema, which unconditionally runsCREATE TABLE files(db.go:176-191). If the database already has afilestable butuser_versionis 0 — a database created by some other tool, a partially initialized file, or one whoseuser_versionwas reset — the user getscreate schema: table files already exists, which explains nothing and suggests no action.README §Database says a database whose schema version is not 1 is a fatal error, so the intended behaviour for an unrecognized database is a clear schema-version error, not a raw SQLite complaint.
Definition of done
initSchemadistinguishes a genuinely empty database from one that has afilestable but no recognized version, and reports the latter with a clear fatal error naming the file and telling the operator to remove it and rescan.createSchemausesCREATE TABLE IF NOT EXISTS— but only if the version is then still validated, so an unversioned foreign database is not silently adopted.filestable anduser_version = 0and asserts the error message.make checkgreen.