from enum import Enum
from tortoise import Model, fields
from tortoise.fields import BigIntField, IntField, CharEnumField
class ColorEnum(str, Enum):
RED = '1'
GREEN = '2'
BLUE = '3'
YELLOW = '4'
GRAY = '5'
class Cup(Model):
id = BigIntField(pk=True)
price = IntField()
sell_num = IntField()
color = CharEnumField(ColorEnum, default=ColorEnum.RED)
class Meta:
table = 'cups'
init
from tortoise.contrib.fastapi import register_tortoise
register_tortoise(
app,
config=config.TORTOISE_ORM
)
过程
在数据库 A 先后进行了迁移一,迁移二,迁移三,此时,aerich 表的 content 字段内容不同
然后,更换到数据库 B 执行 aerich upgrade 此时 aerich 表的 content 字段内容全部相同
question
表现: 不同迁移的 content 字段内容会一致
version
config.py
model
init
过程
在数据库 A 先后进行了迁移一,迁移二,迁移三,此时,aerich 表的 content 字段内容不同
然后,更换到数据库 B 执行
aerich upgrade
此时 aerich 表的 content 字段内容全部相同最后
这个算正常还是不正常?