3

I just clone exiting project from github, and dump mysql database in my local machine. Every thing is working fine. I made some changes in myapp/model.py, like add new tables. After that when run
1. python ./manage.py makemigrations myapp. Then it makes migration files like

Migrations for 'myapp':
  0001_initial.py:
    - Create model AndroidRegkey
    - Create model ApkVersion
     ....................... 
     .......................
  1. python manage.py migrate myapp it gives following message

    Operations to perform:
      Apply all migrations: myapp
    Running migrations:
      No migrations to apply.
    

This is the first time migration on my local machine. I already have database. But after Adding new models in model.py first time it does not apply any migration to data base, why?

I also go this link stack-over flow but not working.

When I ran python manage.py migrate --list Getting following result.

admin
 [X] 0001_initial
auth
 [X] 0001_initial
contenttypes
 [X] 0001_initial
intracity
 (no migrations)
mailer
 [X] 0001_initial
 [X] 0002_auto_20150720_1433
sessions
 [X] 0001_initial
Community
  • 1
  • 1
geeks
  • 2,025
  • 6
  • 31
  • 49

1 Answers1

2

When you apply migrations, the migrations that have been applied are stored in the database. They will also be exported to your database dump. So your database should already be in the correct state after you import the data locally. Django looks at the relevant table, sees you're up to date, and takes no further action.