gitModels.py 815 B

123456789101112131415161718192021
  1. from tortoise.models import Model
  2. from tortoise import fields
  3. class Users(Model):
  4. id = fields.IntField(pk=True)
  5. uuid = fields.UUIDField(unique=True)
  6. username = fields.CharField(max_length=50, unique=True, index=True)
  7. session = fields.CharField(max_length=50, unique=True)
  8. password = fields.CharField(max_length=50)
  9. permission = fields.JSONField()
  10. git_info = fields.JSONField()
  11. avatar = fields.CharField(max_length=500, null=True)
  12. email = fields.CharField(max_length=50, null=True)
  13. registTime = fields.BigIntField()
  14. class Repos(Model):
  15. id = fields.IntField(pk=True)
  16. name = fields.CharField(max_length=50)
  17. state = fields.IntField()
  18. create_user = fields.CharField(max_length=36)
  19. path = fields.CharField(max_length=500)
  20. update_time = fields.BigIntField()