Skip to content

Commit

Permalink
Merge pull request #66 from peteeckel/fix/reindexing-migration
Browse files Browse the repository at this point in the history
Removed re-indexing migration
  • Loading branch information
peteeckel authored Sep 19, 2023
2 parents 3ddec28 + 399c7d0 commit 4384eb0
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 4384eb0

Please sign in to comment.