mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Fixes #11658: Remove reindex command call from search migration
This commit is contained in:
parent
9efc4689cc
commit
e635e3e959
@ -1,27 +1,10 @@
|
|||||||
import sys
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import django.db.models.lookups
|
import django.db.models.lookups
|
||||||
from django.core import management
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
def reindex(apps, schema_editor):
|
|
||||||
# Build the search index (except during tests)
|
|
||||||
if 'test' not in sys.argv:
|
|
||||||
management.call_command(
|
|
||||||
'reindex',
|
|
||||||
'circuits',
|
|
||||||
'dcim',
|
|
||||||
'extras',
|
|
||||||
'ipam',
|
|
||||||
'tenancy',
|
|
||||||
'virtualization',
|
|
||||||
'wireless',
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
@ -57,8 +40,4 @@ class Migration(migrations.Migration):
|
|||||||
'ordering': ('weight', 'object_type', 'object_id'),
|
'ordering': ('weight', 'object_type', 'object_id'),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.RunPython(
|
|
||||||
code=reindex,
|
|
||||||
reverse_code=migrations.RunPython.noop
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user