Closes #20954: Add indexes for GFKs (#21015)

This commit is contained in:
Jeremy Stretch
2025-12-18 17:49:00 -05:00
committed by GitHub
parent 2eb42d4907
commit 712c743bcb
10 changed files with 111 additions and 8 deletions

View File

@@ -0,0 +1,20 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('dcim', '0225_gfk_indexes'),
('extras', '0134_owner'),
('ipam', '0086_gfk_indexes'),
('tenancy', '0022_add_comments_to_organizationalmodel'),
('users', '0015_owner'),
('wireless', '0016_owner'),
]
operations = [
migrations.AddIndex(
model_name='wirelesslan',
index=models.Index(fields=['scope_type', 'scope_id'], name='wireless_wi_scope_t_6740a3_idx'),
),
]

View File

@@ -113,6 +113,9 @@ class WirelessLAN(WirelessAuthenticationBase, CachedScopeMixin, PrimaryModel):
class Meta:
ordering = ('ssid', 'pk')
indexes = (
models.Index(fields=('scope_type', 'scope_id')),
)
verbose_name = _('wireless LAN')
verbose_name_plural = _('wireless LANs')