from django.db import models from django.conf import settings from pingcap_sso.managers.tidb_contributor import TiDBContributorManager class TiDBContributor(models.Model): github_id = models.IntegerField(primary_key=True) github_username = models.CharField(max_length=255) pr_count = models.IntegerField(default=0) user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING, blank=True, null=True ) updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True) objects = TiDBContributorManager() class Meta: db_table = 'pingcap_tidb_contributors'