mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-26 18:38:38 -06:00
Closes #18191: Remove redundant SQL indexes
This commit is contained in:
parent
6a966ee6c1
commit
c4c95ea7bd
25
netbox/core/migrations/0014_remove_redundant_indexes.py
Normal file
25
netbox/core/migrations/0014_remove_redundant_indexes.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Generated by Django 5.2b1 on 2025-04-03 18:32
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0013_datasource_sync_interval'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveIndex(
|
||||
model_name='autosyncrecord',
|
||||
name='core_autosy_object__c17bac_idx',
|
||||
),
|
||||
migrations.RemoveIndex(
|
||||
model_name='datafile',
|
||||
name='core_datafile_source_path',
|
||||
),
|
||||
migrations.RemoveIndex(
|
||||
model_name='managedfile',
|
||||
name='core_managedfile_root_path',
|
||||
),
|
||||
]
|
@ -310,9 +310,6 @@ class DataFile(models.Model):
|
||||
name='%(app_label)s_%(class)s_unique_source_path'
|
||||
),
|
||||
)
|
||||
indexes = [
|
||||
models.Index(fields=('source', 'path'), name='core_datafile_source_path'),
|
||||
]
|
||||
verbose_name = _('data file')
|
||||
verbose_name_plural = _('data files')
|
||||
|
||||
@ -387,8 +384,5 @@ class AutoSyncRecord(models.Model):
|
||||
name='%(app_label)s_%(class)s_object'
|
||||
),
|
||||
)
|
||||
indexes = (
|
||||
models.Index(fields=('object_type', 'object_id')),
|
||||
)
|
||||
verbose_name = _('auto sync record')
|
||||
verbose_name_plural = _('auto sync records')
|
||||
|
@ -58,9 +58,6 @@ class ManagedFile(SyncedDataMixin, models.Model):
|
||||
name='%(app_label)s_%(class)s_unique_root_path'
|
||||
),
|
||||
)
|
||||
indexes = [
|
||||
models.Index(fields=('file_root', 'file_path'), name='core_managedfile_root_path'),
|
||||
]
|
||||
verbose_name = _('managed file')
|
||||
verbose_name_plural = _('managed files')
|
||||
|
||||
|
17
netbox/dcim/migrations/0207_remove_redundant_indexes.py
Normal file
17
netbox/dcim/migrations/0207_remove_redundant_indexes.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.2b1 on 2025-04-03 18:32
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0206_load_module_type_profiles'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveIndex(
|
||||
model_name='cabletermination',
|
||||
name='dcim_cablet_termina_884752_idx',
|
||||
),
|
||||
]
|
@ -299,9 +299,6 @@ class CableTermination(ChangeLoggedModel):
|
||||
|
||||
class Meta:
|
||||
ordering = ('cable', 'cable_end', 'pk')
|
||||
indexes = (
|
||||
models.Index(fields=('termination_type', 'termination_id')),
|
||||
)
|
||||
constraints = (
|
||||
models.UniqueConstraint(
|
||||
fields=('termination_type', 'termination_id'),
|
||||
|
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'),
|
||||
|
Loading…
Reference in New Issue
Block a user