-
朱剑飞 authored52aa9034
README.md 674 bytes
pmebox
Dev
同步数据库更新
1. 初始化(仅初次使用)
aerich init -t common.config.TORTOISE_ORM
# create migrate location ./migrations
# write config to pyproject.toml
aerich init-db
# create app migrate location migrations/models
# generate schema for app "models"
2. 模型有变更时,生成迁移文件
aerich migrate --name add_name_desc
# migrate 1_20221114234032_add_name_desc.py
3. 迁移文件生成表
aerich upgrade
4. 回到上一次迁移
aerich downgrade
更新依赖文件
poetry export -f requirements.txt --output requirements.txt --without-hashes