码迷,mamicode.com
首页 > 其他好文 > 详细

django makemigrations的一个特性

时间:2016-06-14 23:37:28      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:

Migrations will run the same way on the same dataset and produce consistent results, meaning that what you see in development and staging is, under the same circumstances, exactly what will happen in production.

Django will make migrations for any change to your models or fields - even options that don’t affect the database - as the only way it can reconstruct a field correctly is to have all the changes in the history, and you might need those options in some data migrations later on (for example, if you’ve set custom validators).

 

自带的migrate会把所有改动都生成migrations.py,即使对数据库没有影响的改动。

而以前版本的south则不会。

django makemigrations的一个特性

标签:

原文地址:http://www.cnblogs.com/wswang/p/5585663.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!