Django migrate : doesn't create tables

前端 未结 10 1728
独厮守ぢ
独厮守ぢ 2021-01-31 18:03

After some errors, I dropped my database, deleted all my migration files (I left init.py). Now, when I run

python migrate.py makemigrations   /         


        
10条回答
  •  难免孤独
    2021-01-31 18:52

    I had manually deleted one of the tables and the trick that worked for me was to execute the following steps:

    1. Removed the migrations folder.
    2. deleted the migrations from db: DELETE from django_migrations WHERE app='alerts_db';
    3. python manage.py migrate --run-syncdb' before
    4. python manage.py makemigrations 'app_name'
    5. python manage.py migrate --fake

    Note: earlier I was not executing the #3 step and the table was not getting created. my django version: v3.0.5

提交回复
热议问题