Forums

Database records missing

I have my project on pythonanywhere from a few months. I just noticed a issue in my project. I cannot find any record in the database of January 2021. All the records before that are present. It is a django-react web app. I am using default sqlite as database for that. I have also checked the server access logs, In the logs successful requests are mentioned with the date 21st January but there are no records present in the database. I haven't made any changes in the project before or after that.

Do you see anything in your error log?

I have checked the error logs. There is no log in that. I also tried adding records, It works fine now.

I'm afraid there's no way for us to know what happened to your database records. One thing that is a common error that can cause this sort of thing is when your web app has a 'delete' endpoint that acts on a GET request. Then a spider for a search engine comes past and hits that URL, deleting the records.

Actually In my app I am not using the DELETE endpoint. Is it possible that the sqlite file may have reverted to what it was before January. Because only the records of january are missing.

Oh, could that mean that you keep the database under version control system, like git?