Git corrupts SQLite database
This was what I finally figured out, in case someone else comes along and hits the same problem. It was very confusing because the corruption was coming from git, so when I did something like rollback, it got corrupted then, not with my own activities.

I am running PHPStorm on Windows, with a shared directory on a virtual linux machine.  I need line endings to be LF, but since PHPStorm is running in Windows, the CRLF and LF battles ensue.  

I had long ago fixed it with .gitattributes.  But when I switched from MySQL to SQLite, I had not added .db as a file not to be messed with when it came to line endings.

Git was replacing a CRLF with an LF in the .db binary file

In .gitattributes, you need:

# Set the default behavior to always be linefeed for linux
* text=auto

# Definitively text files
*.txt text eol=lf
*.php text eol=lf
*.html text eol=lf
...

# Ensure those won't be changed
*.jpg -text
*.png -text
*.db -text   


I added the last line and all was well, git is no longer trying to be helpful with the binary file and corrupting it with LFs. 

One last thing I learned, you can set the gitattributes file, then go to your root directory and run the command:

git add --renormalize .
git status


You will then see any file that will be converted from CRLF to LF, a good way to fix an entire directory as well as making sure it is not doing to the SQLite database.