mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-25 00:36:11 -06:00
Add indexes for value field
This commit is contained in:
parent
eb1557c171
commit
4fff0996ab
@ -1,5 +1,3 @@
|
|||||||
# Generated by Django 4.1.1 on 2022-10-10 18:22
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
||||||
@ -20,7 +18,7 @@ class Migration(migrations.Migration):
|
|||||||
('object_id', models.PositiveBigIntegerField()),
|
('object_id', models.PositiveBigIntegerField()),
|
||||||
('field', models.CharField(max_length=200)),
|
('field', models.CharField(max_length=200)),
|
||||||
('type', models.CharField(max_length=30)),
|
('type', models.CharField(max_length=30)),
|
||||||
('value', models.TextField()),
|
('value', models.TextField(db_index=True)),
|
||||||
('weight', models.PositiveSmallIntegerField(default=1000)),
|
('weight', models.PositiveSmallIntegerField(default=1000)),
|
||||||
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
|
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
|
||||||
],
|
],
|
||||||
@ -28,4 +26,9 @@ class Migration(migrations.Migration):
|
|||||||
'ordering': ('weight', 'object_type', 'object_id'),
|
'ordering': ('weight', 'object_type', 'object_id'),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='customfield',
|
||||||
|
name='search_weight',
|
||||||
|
field=models.PositiveSmallIntegerField(default=1000),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
# Generated by Django 4.1.1 on 2022-10-12 13:56
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('extras', '0079_search'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='customfield',
|
|
||||||
name='search_weight',
|
|
||||||
field=models.PositiveSmallIntegerField(default=1000),
|
|
||||||
),
|
|
||||||
]
|
|
@ -1,4 +1,3 @@
|
|||||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
@ -30,7 +29,9 @@ class CachedValue(models.Model):
|
|||||||
type = models.CharField(
|
type = models.CharField(
|
||||||
max_length=30
|
max_length=30
|
||||||
)
|
)
|
||||||
value = models.TextField()
|
value = models.TextField(
|
||||||
|
db_index=True
|
||||||
|
)
|
||||||
weight = models.PositiveSmallIntegerField(
|
weight = models.PositiveSmallIntegerField(
|
||||||
default=1000
|
default=1000
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user