So this morning I was trying to update a testing machine with my shiny new Rails app.
- Remove the sqlite database – CHECK
- run rake db:migrate – CHECK
- start the application
Now there were no errors anywhere. But I still get:
SQLite3::SQLException: SQL logic error or missing database
After usual googling around and trying to fix it I just saw what the problem with the Query is. The reason for the exception is putting a ‘NULL’ into non NULL column. And SQLite says “missing database”. Way to write the exceptions.
Note to Self: Always write meaningful or at least non-misleading exception messages.
Posted in:
Programming
This may also come up, if the db-file is read-only (for the apache-/php-process)
Make sure you close the ResultSet and the Statements.
if your problem is related to android..ie if you are losing database created on sdcard everytime you start emulator …then please dont select wipe user data while starting the emulator