mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Add index for (source, path) to DataFile
This commit is contained in:
parent
73a7a2d27a
commit
368e774ceb
@ -59,4 +59,8 @@ class Migration(migrations.Migration):
|
||||
model_name='datafile',
|
||||
constraint=models.UniqueConstraint(fields=('source', 'path'), name='core_datafile_unique_source_path'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='datafile',
|
||||
index=models.Index(fields=['source', 'path'], name='core_datafile_source_path'),
|
||||
),
|
||||
]
|
||||
|
@ -273,6 +273,9 @@ class DataFile(models.Model):
|
||||
name='%(app_label)s_%(class)s_unique_source_path'
|
||||
),
|
||||
)
|
||||
indexes = [
|
||||
models.Index(fields=('source', 'path'), name='core_datafile_source_path'),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
return self.path
|
||||
|
Loading…
Reference in New Issue
Block a user