How do I delete DB (sqlite3) in Django 1.9 to start from scratch?

前端 未结 4 1720
庸人自扰
庸人自扰 2020-12-07 15:28

I made a spelling error in my model and now one of my columns is misspelled. I\'d like to drop all tables in the database, fix the error in the model.py, and recreate the da

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 15:33

    rm -f tmp.db db.sqlite3 rm -r my-app/migrations python manage.py makemigrations python manage.py migrate

    Removes the database.
    Removes the migrations from your app.
    Re-runs the migrations. Note: you could also do: python manage.py makemigrations my-app
    Migrate changes.

提交回复
热议问题