pythondjangosqlitepycharm

How to remove and add completly new db.sqlite3 to django project written in pycharm?


How to remove and add completly new db.sqlite3 database to django project written in pycharm? I did something wrong and I need completely new database. The 'flush' command just removes data from database but it doesn't remove tables schema. So the question is how to get get back my database to begin point (no data, no sql table)


Solution

  • A SQLite database is just a file. To drop the database, simply remove the file.

    When using SQLite, python manage.py migrate will automatically create the database if it doesn't exist.