1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #14436: Add indexes for all GenericForeignKey fields (#14463)

* Closes #14436: Add PostgreSQL indexes for all GenericForeignKeys

* Add note about GFK indexes to developer docs
This commit is contained in:
Jeremy Stretch
2023-12-07 14:02:51 -05:00
committed by GitHub
parent 2d1f882724
commit b532435a6d
22 changed files with 208 additions and 15 deletions

View File

@ -219,6 +219,10 @@ class Migration(migrations.Migration):
'ordering': ('tunnel', 'role', 'pk'),
},
),
migrations.AddIndex(
model_name='tunneltermination',
index=models.Index(fields=['termination_type', 'termination_id'], name='vpn_tunnelt_termina_c1f04b_idx'),
),
migrations.AddConstraint(
model_name='tunneltermination',
constraint=models.UniqueConstraint(fields=('termination_type', 'termination_id'), name='vpn_tunneltermination_termination', violation_error_message='An object may be terminated to only one tunnel at a time.'),