Compare commits

..

2 Commits

Author SHA1 Message Date
3f8739d035 Merge pull request #160 from SDSRV-IDP/dev/indexing_DB
Indexing DB
2024-11-04 14:13:26 +07:00
57364148cf Indexing DB 2024-11-04 14:11:09 +07:00
3 changed files with 9 additions and 2 deletions

View File

@ -8,7 +8,7 @@ class SubscriptionRequest(models.Model):
pages: int = models.IntegerField() pages: int = models.IntegerField()
pages_left: int = models.IntegerField(default=1) pages_left: int = models.IntegerField(default=1)
doc_type: str = models.CharField(max_length=100) doc_type: str = models.CharField(max_length=100)
request_id = models.CharField(max_length=200) # Change to request_id request_id = models.CharField(max_length=200, db_index=True) # Change to request_id
redemption_id = models.CharField(max_length=200, null=True) redemption_id = models.CharField(max_length=200, null=True)
process_type = models.CharField(max_length=200) # driver/id/invoice process_type = models.CharField(max_length=200) # driver/id/invoice
provider_code = models.CharField(max_length=200, default="Guest") # Request source FWD/CTel provider_code = models.CharField(max_length=200, default="Guest") # Request source FWD/CTel

View File

@ -35,3 +35,10 @@ class SubscriptionRequestFile(models.Model):
feedback_accuracy = models.JSONField(null=True) feedback_accuracy = models.JSONField(null=True)
reviewed_accuracy = models.JSONField(null=True) reviewed_accuracy = models.JSONField(null=True)
class Meta:
indexes = [
models.Index(fields=['request', 'index_in_request', 'doc_type']), # For updating results
models.Index(fields=['request', 'file_name']), # for getting image files by AI
]

View File

@ -6,7 +6,7 @@ from fwd_api.constant.common import EntityStatus
class UserProfile(models.Model): class UserProfile(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True, db_index=True)
user_name: str = models.CharField(max_length=200, null=True) user_name: str = models.CharField(max_length=200, null=True)
password: str = models.CharField(max_length=200, null=True) password: str = models.CharField(max_length=200, null=True)
full_name: str = models.CharField(max_length=200, null=True) full_name: str = models.CharField(max_length=200, null=True)