0

I recently deleted my db.sqlite3 file because some data had become corrupted. I though that at the next run of python manage.py migrate it would have simply been recreated from stratch. Instead, Django is contuining to work off the old db.sqlite3 despite the file not existing anymore - I assume it's somehow cached?

Specifically:

  • python manage.py migrate works fine but it doesn't create a new db.sqlite3 file.
  • There is no db.sqlite3 file anymore in my root.
  • I already manually deleted all migrations.
  • The app continues to work okay with all the previous data still there (e.g., users).
  • In case it's useful, I'm coding on Replit.
Edgar Derby
  • 2,543
  • 4
  • 29
  • 48
  • It does sound like the file is still there. Maybe a stupid question, but are you sure that you deleted the correct file? Maybe you just deleted a backup/copy? Could the file being used be in a sub-folder? – Ralf Dec 13 '21 at 14:39
  • Could it be a cache issue, meaning, that the file is still available? (because you mentioned using "replit") – Ralf Dec 13 '21 at 14:40
  • @Ralf I can confirm it doesn't exist, I even search with the find command just in case (but also I see the file is not there). Cache could be an answer, but it doesn't fly: I can also add new rows to the db, which doesn't make sense. I'm... Confused. :) – Edgar Derby Dec 13 '21 at 17:08
  • A simple/fast solution is to change the name of the file in `settings.py`, so `migrate`-command will create a new file; this does not explain your issue, but it goes around it – Ralf Dec 13 '21 at 18:22

0 Answers0