不要生成不必要的迁移

django-migrations-ignore-attrs的Python项目详细描述


https://img.shields.io/pypi/v/django-migrations-ignore-attrs.svghttps://travis-ci.org/dex4er/django-migrations-ignore-attrs.svg?branch=masterhttps://readthedocs.org/projects/django-migrations-ignore-attrs/badge/?version=latesthttps://img.shields.io/pypi/pyversions/django-migrations-ignore-attrs.svghttps://img.shields.io/pypi/djversions/django-migrations-ignore-attrs.svg

django迁移忽略属性

django migrations ignore attrs是覆盖^{tt1}的包$ 以及用于django的manage.py命令的migrate命令。

django migrations ignore attrs允许避免进行不必要的迁移 对于在数据库架构中没有任何表示的属性。

忽略模型的以下属性:

  • 详细名称
  • 详细名称复数

标准字段的以下属性将被忽略:

  • 选择
  • 帮助文本
  • 详细名称

忽略ForeignKey的以下属性:

  • 相关名称
  • 相关查询名称

安装

使用pippipenv安装:

pipinstalldjango-migrations-ignore-attrs

django_migrations_ignore_attrs添加到 settings.py文件:

INSTALLED_APPS=['django_migrations_ignore_attrs',...]

可选配置:

# ignored attributes of modelMIGRATION_IGNORE_MODEL_ATTRS=['verbose_name','verbose_name_plural']# ignored attributes of standard fieldsMIGRATION_IGNORE_FIELD_ATTRS=['choices','help_text','verbose_name']# ignored attributes of ForeignKeyMIGRATION_IGNORE_RELATED_FIELD_ATTRS=['related_name','related_query_name']

命令

生成迁移

为应用程序创建新迁移。

所有选项都与原始的makemigrations命令相同 django应用程序。

迁移

更新数据库架构。管理有迁移的应用程序和没有迁移的应用程序。

所有选项都与来自^{tt9}的原始migrate命令相同$ 应用程序。

许可证

版权所有©2019,Piotr Roszatycki

该软件在GNU Lesser General Public License(LGPL)下分发 3或更大)。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java操作数组上的字符串   java JAXB内容未实例化   图形在Java中如何绘制垂直居中的字符串?   java Apache Ant:使用Junit时出现NoClassDefFoundError   java无法从服务器上运行perl脚本   如何在java中沿树进行预排序遍历,并打印0和1以对应每个节点上的特定字符?   java如何创建。p12文件?   java线程访问无效   java只匹配命名空间中的XML节点,而不知道NS前缀   从java获取2d arraylist元素   数组Java动态集合对象   java Xpath通过通配符或布尔运算查找以相同名称开头的节点?   java注释元素类型   java在中看不到Super()。反编译后的类文件