Refuse an unversioned database that already has a files table (closes #11)
check / check (push) Failing after 2s
check / check (push) Failing after 2s
A database at user_version 0 that already has a files table was not created by sfdupes: a foreign or partially initialized file. 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 check for a files table at version 0 and refuse such a database with the schema-version error telling the operator to remove the file and rescan. A genuinely empty database is unchanged: scan creates the schema, report and trees refuse it as before. Model: opus-4-8 (implementation); opus-5-5 (rebase)
This commit is contained in:
@@ -209,7 +209,10 @@ All three subcommands operate on a single SQLite database file:
|
||||
`-shm` files beside it, which SQLite creates with the database
|
||||
file's permissions.
|
||||
- Schema (`PRAGMA user_version` is the schema version, currently 1; a
|
||||
database with any other version is a fatal error):
|
||||
database with any other version is a fatal error. A database at
|
||||
version 0 that already has a `files` table was not made by sfdupes;
|
||||
every subcommand refuses it with an error telling the user to remove
|
||||
the file and rescan):
|
||||
|
||||
```sql
|
||||
CREATE TABLE files (
|
||||
|
||||
Reference in New Issue
Block a user