[[!comment format=mdwn
 username="joey"
 subject="""comment 4"""
 date="2017-06-26T16:20:29Z"
 content="""
In a v6 repository, the sqlite database is used to keep track of unlocked
files. If all files are locked, the sqlite database can still be deleted
safely.

I've done some experimentation with deleting the sqlite database when there
are unlocked files, and it seems that running `git annex fsck` manages to
recover the deleted state and restores the database.

Also, since git-annex uses sqlite in WAL mode, it may be possible to
recover the database to the last good state by deleting
`.git/annex/keys/db-wal`. You'd still want to run `git annex fsck`.
"""]]
