Django migrate : doesn't create tables

前端 未结 10 1713
独厮守ぢ
独厮守ぢ 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:42

    I face same issue:

    python manage.py migrate poll
    Operations to perform:
      Apply all migrations: poll
    Running migrations:
      No migrations to apply.
    

    Follow these steps to create tables for your app.

    Go to your app folder

    1.delete migration folder.

    2.python manage.py makemigrations.

    3 Rename 0001_initial.py file to 0001_initial_manual.py.

    4 python manage.py migrate APPNAME.

    After this my tables created smoothly.

    python manage.py migrate poll
    Operations to perform:
      Apply all migrations: poll
    Running migrations:
      Applying poll.0002_initial... OK
    

提交回复
热议问题