【文件属性】:
文件名称:django-syzygy:Django应用程序提供数据库迁移工具以自动执行其部署
文件大小:36KB
文件格式:ZIP
更新时间:2021-03-20 04:16:04
Python
django-syzygy Django应用程序提供了数据库迁移工具来自动化其部署。
受到在启发,并在移民工作。
安装
pip install django-syzygy
用法
在您的INSTALLED_APPS添加'syzygy'
# settings.py
INSTALLED_APPS = [
...
' syzygy ',
...
]
在部署代码更改之前,先设置部署管道以运行migrate --pre-deploy然后再进行migrate以应用推迟的迁移。
概念
Syzygy引入了有关部署的先决条件和推迟迁移的概念。
除非迁移包含破坏性操作,或者迁移的stage类属性设置为Stage.POST_DEPLOY否则假定迁移是部署的先决条件。定义此属性后,它将绕过基于启发式的operations 。
例如,这种迁移将被视为先决条件
class Migration
【文件预览】:
django-syzygy-master
----.gitignore(76B)
----setup.cfg(309B)
----README.rst(6KB)
----.github()
--------workflows()
----tests()
--------test_plan.py(8KB)
--------settings()
--------test_commands.py(7KB)
--------test_quorum.py(3KB)
--------models.py(65B)
--------test_autodetector.py(8KB)
--------test_operations.py(10KB)
--------__init__.py(0B)
--------test_checks.py(1KB)
--------test_migrations()
----LICENSE(1KB)
----syzygy()
--------conf.py(1KB)
--------exceptions.py(87B)
--------compat.py(520B)
--------constants.py(109B)
--------plan.py(6KB)
--------__init__.py(189B)
--------apps.py(401B)
--------management()
--------checks.py(2KB)
--------operations.py(8KB)
--------quorum()
--------autodetector.py(8KB)
----setup.py(1KB)
----tox.ini(2KB)