aerich 使用说明
aerich
是一种ORM迁移工具,需要结合tortoise
异步orm框架使用。
aerich-github:https://github.com/long2ice/aerich
Tortoise教程:https://tortoise-orm.readthedocs.io/en/latest/getting_started.html
安装aerich
pip install aerich
用法
项目目录结构:
from tortoise import models, Tortoise, fields
class User(models.Model):
"""User类"""
id = fields.IntField(pk=True)
phone = fields.CharField(20, null=True)
phone_nation_code = fields.CharField(8, null=True)
email = fields.CharField(