[英]python manage.py makemigrations gives No changes detected?
I just clone exiting project from github, and dump mysql database in my local machine . 我只是从github克隆退出项目,并在我的本地机器中转储mysql数据库 。 Every thing is working fine.
一切都很好。 I made some changes in myapp/model.py, like add new tables.
我在myapp / model.py中做了一些更改,比如添加新表。 After that when run
之后运行
1. python ./manage.py makemigrations myapp
. 1.
python ./manage.py makemigrations myapp
。 Then it makes migration files like 然后它使迁移文件像
Migrations for 'myapp':
0001_initial.py:
- Create model AndroidRegkey
- Create model ApkVersion
.......................
.......................
python manage.py migrate myapp
it gives following message python manage.py migrate myapp
它给出了以下消息
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?
但是在第一次在model.py中添加新模型后, 它不会应用任何迁移到数据库,为什么?
I also go this link stack-over flow but not working. 我也去了这个链接堆栈流但不工作。
When I ran python manage.py migrate --list
Getting following result. 当我运行
python manage.py migrate --list
获得以下结果。
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
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.
Django查看相关表格,看到您是最新的,并且不采取进一步行动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.