mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-16 16:52:17 -06:00
* Closes #18191: Remove redundant SQL indexes * Update developer documentation * Add a system check for duplicate indexes
This commit is contained in:
21
netbox/vpn/migrations/0009_remove_redundant_indexes.py
Normal file
21
netbox/vpn/migrations/0009_remove_redundant_indexes.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 5.2b1 on 2025-04-03 18:32
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('vpn', '0008_add_l2vpn_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveIndex(
|
||||
model_name='l2vpntermination',
|
||||
name='vpn_l2vpnte_assigne_9c55f8_idx',
|
||||
),
|
||||
migrations.RemoveIndex(
|
||||
model_name='tunneltermination',
|
||||
name='vpn_tunnelt_termina_c1f04b_idx',
|
||||
),
|
||||
]
|
||||
@@ -110,9 +110,6 @@ class L2VPNTermination(NetBoxModel):
|
||||
|
||||
class Meta:
|
||||
ordering = ('l2vpn',)
|
||||
indexes = (
|
||||
models.Index(fields=('assigned_object_type', 'assigned_object_id')),
|
||||
)
|
||||
constraints = (
|
||||
models.UniqueConstraint(
|
||||
fields=('assigned_object_type', 'assigned_object_id'),
|
||||
|
||||
@@ -138,9 +138,6 @@ class TunnelTermination(CustomFieldsMixin, CustomLinksMixin, TagsMixin, ChangeLo
|
||||
|
||||
class Meta:
|
||||
ordering = ('tunnel', 'role', 'pk')
|
||||
indexes = (
|
||||
models.Index(fields=('termination_type', 'termination_id')),
|
||||
)
|
||||
constraints = (
|
||||
models.UniqueConstraint(
|
||||
fields=('termination_type', 'termination_id'),
|
||||
|
||||
Reference in New Issue
Block a user