从官方文档的意思来看,现在他已经成为migrate命令的同义词了,和migrate命令有相同的作用。

Deprecated since version 1.7: This command has been deprecated in favor of the migrate command, which performs both the old behavior as well as executing migrations. It is now just an alias to that command

  migrate命令的作用:

migrate [<app_label> [<migrationname>]]

django-admin migrate
New in Django 1.7.

Synchronizes the database state with the current set of models and migrations. Migrations, their relationship with apps and more are covered in depth in the migrations documentation.

The behavior of this command changes depending on the arguments provided:

  • No arguments: All migrated apps have all of their migrations run, and all unmigrated apps are synchronized with the database,
  • <app_label>: The specified app has its migrations run, up to the most recent migration. This may involve running other apps’ migrations too, due to dependencies.
  • <app_label> <migrationname>: Brings the database schema to a state where the named migration is applied, but no later migrations in the same app are applied. This may involve unapplying migrations if you have previously migrated past the named migration. Use the name zero to unapply all migrations for an app.

Unlike syncdb, this command does not prompt you to create a superuser if one doesn’t exist (assuming you are using django.contrib.auth). Use createsuperuser to do that if you wish.

The --database option can be used to specify the database to migrate.

--fake

The --fake option tells Django to mark the migrations as having been applied or unapplied, but without actually running the SQL to change your database schema.

This is intended for advanced users to manipulate the current migration state directly if they’re manually applying changes; be warned that using --fake runs the risk of putting the migration state table into a state where manual recovery will be needed to make migrations run correctly.

New in Django 1.8.
--fake-initial

The --fake-initial option can be used to allow Django to skip an app’s initial migration if all database tables with the names of all models created by all CreateModel operations in that migration already exist. This option is intended for use when first running migrations against a database that preexisted the use of migrations. This option does not, however, check for matching database schema beyond matching table names and so is only safe to use if you are confident that your existing schema matches what is recorded in your initial migration.

Deprecated since version 1.8: The --list option has been moved to the showmigrations command.

最新文章

  1. 视图UIView的大小和位置属性详解
  2. 成都app开发:架构一个App需要学会哪些技术呢?
  3. php 批量生成html、txt文件
  4. MD5是什么,怎么用着怪怪的
  5. JSP-注释,脚本元素,指令
  6. isotope/masonry 使用jQuery.sortable
  7. 共享数据的包含const
  8. Agent Job代理 执行SSIS Package
  9. DEDECMS 漏洞修复方案
  10. 简单了解下java中的堆、栈和方法区。
  11. postgresql-分页重复数据探索
  12. 理解Vuex的辅助函数mapState, mapActions, mapMutations用法
  13. 博主自传——蒟蒻的OI之路
  14. PhpStudy的安装及使用教程
  15. C++IO cin
  16. mybaits模糊查询使用&lt;bind&gt;标签
  17. Jenkins Maven安装设置
  18. 《剑指offer》— JavaScript(26)二叉搜索树与双向链表
  19. PHP 图像居中裁剪函数
  20. Linux文件与目录操作

热门文章

  1. 初学Java9:学习Mybatis时报错:Parameter &#39;name&#39; not found. Available parameters are [1, 0, param1, param2]
  2. Ahjesus Nodejs01 环境搭建及运行
  3. jquery常用选择器
  4. ASP.NET MVC的请求生命周期
  5. React对话框组件实现
  6. Windows Azure 上传 VM
  7. andriod 图片选择器
  8. 转:HTTP 1.1与HTTP 1.0的比较
  9. UITabBar,UINavigationBar的布局和隐藏问题
  10. Android 开发组件