Andrei Tudor
Andrei Tudor

Reputation: 33

Django - doesn`t make the migrations

In Django, after I created a model, in cmd I runned: "python manage.py makemigrations" and returned that: Migrations for 'hello': hello\migrations\0001_initial.py - Create model Article hello is the name of app. And after I runned: "python manage.py migrate" returned: Operations to perform: Apply all migrations: admin, auth, contenttypes, hello, sessions Running migrations: No migrations to apply.

And when I try to introduce a field in that model appear: OperationalError at /admin/hello/article/add/ no such table: hello_article

I tried to delete all migrations and I created again the model and the result was the same. How fix this?

Upvotes: 0

Views: 2071

Answers (1)

snipher marube
snipher marube

Reputation: 129

I suggest you try deleting migration files in migration folder and then delete db.sqlite3 since model tables are stored in the database. Now run python manage.py makemigrations and finally run python manage.py migrate

Upvotes: 0

Related Questions