简体   繁体   English

python manage.py makemigrations给出没有检测到变化?

[英]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
     ....................... 
     .......................
  1. 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.

相关问题 python manage.py makemigrations:未检测到更改 - python manage.py makemigrations : No changes detected python manage.py makemigrations博客未在应用“博客”中返回未检测到的更改 - python manage.py makemigrations blog returns no changes detected in app 'blog' 我执行Python manage.py makemigrations和迁移时未检测到更改 - No changes detected when i excute Python manage.py makemigrations and migrate 无法从源/py manage.py makemigrations 解析导入“django.db.models”未检测到更改 - Import "django.db.models" could not be resolved from source / py manage.py makemigrations No changes detected manage.py (python manage.py makemigrations) 错误 - manage.py (python manage.py makemigrations) Error 无法使用Python的manage.py makemigrations迁移数据库 - Not able to migrate DB, using Python's manage.py makemigrations Django 1.7 python manage.py makemigrations轮询SyntaxError - Django 1.7 python manage.py makemigrations polls SyntaxError 终端卡在 python manage.py makemigrations 和 runserver - Terminal is stuck on python manage.py makemigrations and runserver python manage.py makemigrations在升级Django时给出错误 - python manage.py makemigrations giving error on upgrading django python manage.py makemigrations没有名为错误的模块 - python manage.py makemigrations no module named error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM