安装
pip install tortoise-orm
orm迁移工具
pip install aerich
> aerich -hUsage: aerich [OPTIONS] COMMAND [ARGS]...Options:-V, --version 显示版本并退出-c, --config TEXT 配置文件。(默认值:aerich.ini)--app TEXT Tortoise-ORM app 名称.-n, --name TEXT Name of section in .ini file to use for aerich config.要用于aerich配置文件.ini文件中的名称。[default: aerich]-h, --help 显示此消息并退出.Commands:downgrade 降级到指定版本.heads 查看形成当前版本的迁移记录文件history 查看历史迁移记录init 初始化配置文件并生成根迁移目录.init-db 生成模式和生成应用迁移位置.inspectdb Introspects the database tables to standard output as...migrate 生产迁移文件.upgrade 升级到指定版本.
初始化:
aerich init -t core.db.TORTOISE_ORM --location models/migrations
