B
B
Boldy2014-12-07 21:35:53
Django
Boldy, 2014-12-07 21:35:53

Why don't django migrations work?

Added model, completed manage.py makemigrations shop, received

Migrations for 'shop':
  0001_initial.py:
    - Create model Product
    - Create model ShopDirectory
    - Add field category to product

when manage.py migrateI receive
Operations to perform:
  Synchronize unmigrated apps: ...
  Apply all migrations: shop...
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  No migrations to apply.

and nothing happens no matter how much you repeat

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vladislav, 2014-12-07
@RGV

Probably the migration has already passed. Models are definitely not created in the database?
There should be a table in the database called django_migrations (there is exactly migrations in the title). All migrations that were accepted in this database are marked there. Check if it's already accepted.

S
Salavat Sharapov, 2014-12-08
@desperadik

ps If a person does "makemigrations" then he has Django=>1.7
Agree with RGV , connect to the database and see if the tables with the shop_ prefix are created, if there is a record of the migration in the django_migrations table.

L
larionov_n, 2014-12-08
@larionov_n

Try django south, but it's not up to date for the latest version of django.

1
180Ringing, 2019-06-18
@180Ringing

delete from django_migrations
Just be careful)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question