feat(external): add index to ExternalAccess for project and is_active

Improves query performance on project and is_active lookups.
This commit is contained in:
sankalp committed 2026-06-28 15:59:55 +05:45
1 parent d66e03c0ce
commit 51ad3809dd
2 files changed
+22

No files matched your search

@@ -0,0 +1,19 @@
# Generated by Django 6.0.6 on 2026-06-28 10:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("external", "0001_initial"),
("projects", "0002_projectmember_project_mem_user_id_6b0bb0_idx"),
]
operations = [
migrations.AddIndex(
model_name="externalaccess",
index=models.Index(
fields=["project", "is_active"], name="external_ac_project_d7e6b3_idx"
),
),
]
+3
View File
@@ -31,6 +31,9 @@ class ExternalAccess(models.Model):
db_table = "external_access"
verbose_name = "External Access"
verbose_name_plural = "External Accesses"
indexes = [
models.Index(fields=["project", "is_active"]),
]
def __str__(self):
return f"ExternalAccess for {self.project.name}"