Corruption in a SQLite file often stays unnoticed until the one query that hits it. A one-line check finds it earlier.
sqlite3 app.db "PRAGMA integrity_check;"
sqlite3 app.db "PRAGMA foreign_key_check;"
A healthy database prints a single line, ok. Anything else is a list of problems, one per line. PRAGMA quick_check skips some of the slower checks and is fine for a daily cron job on a large file.
integrity_check looks at the file structure and index contents. It does not verify foreign keys, which is what foreign_key_check is for, and it prints rows only for violations.
Further reading: SQLite: PRAGMA Statements