I use SQLite for websites I create and manage for my clients (I am a web developer). They are very small and straightforward databases.
This is now happened twice, so it is pretty clear that it wasn't a fluke. This last one was a clear set of steps that then corrupted the database:
- Open the database in SQLite3 by linux command line
- Make a mistake in the data
- Ask Git to restore the released version of the file (this is reaching out to GitHub for the copy)
- Open the restored version, and file is corrupt
I then struggle to get it back in order, nothing I do in git fixes it. I can luckily grab it from the live website (no updates there) and all is well.
My two questions:
- Is there something I can do differently while getting the file from the git repository to revert, it is not clear to me why git would corrupt the file
- Is there something I can do that is easier to restore the file other than get the copy from the live website