from tortoise.models import Model from tortoise import fields class Users(Model): id = fields.IntField(pk=True) uuid = fields.UUIDField(unique=True) username = fields.CharField(max_length=50, unique=True, index=True) session = fields.CharField(max_length=50, unique=True) password = fields.CharField(max_length=50) permission = fields.JSONField() git_info = fields.JSONField() avatar = fields.CharField(max_length=500, null=True) email = fields.CharField(max_length=50, null=True) registTime = fields.BigIntField() class Repos(Model): name = fields.CharField(max_length=50) state = fields.IntField() create_user = fields.CharField(max_length=36) path = fields.CharField(max_length=500) update_time = fields.BigIntField()