Skip to content

Commit

Permalink
Removed re-indexing migration
Browse files Browse the repository at this point in the history
  • Loading branch information
peteeckel committed Sep 19, 2023
1 parent 3ddec28 commit 399c7d0
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions netbox_dns/migrations/0022_search.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
import sys

from packaging import version

from django.core import management
from django.db import migrations
from django.conf import settings


def reindex(apps, schema_editor):
if "test" not in sys.argv:
if version.parse(settings.VERSION) >= version.parse("3.4.2"):
management.call_command("reindex", "netbox_dns")
else:
management.call_command("reindex", "netbox_dns.view")
management.call_command("reindex", "netbox_dns.nameserver")
management.call_command("reindex", "netbox_dns.zone")
management.call_command("reindex", "netbox_dns.record")


class Migration(migrations.Migration):
dependencies = [
("extras", "0083_search"),
("netbox_dns", "0021_record_ip_address"),
]

operations = [
migrations.RunPython(code=reindex, reverse_code=migrations.RunPython.noop),
]
operations = []

0 comments on commit 399c7d0

Please sign in to comment.