Skip to content

Commit b913661

Browse files
committed
Fixes #18438: Specify batch_size for migrations which run bulk_update()
1 parent d11deb6 commit b913661

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

netbox/circuits/migrations/0048_circuitterminations_cached_relations.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Generated by Django 5.0.9 on 2024-10-21 17:34
21
import django.db.models.deletion
32
from django.db import migrations, models
43

@@ -16,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
1615
termination._site_id = termination.site_id
1716
# Note: Location cannot be set prior to migration
1817

19-
CircuitTermination.objects.bulk_update(terminations, ['_region', '_site_group', '_site'])
18+
CircuitTermination.objects.bulk_update(terminations, ['_region', '_site_group', '_site'], batch_size=100)
2019

2120

2221
class Migration(migrations.Migration):

netbox/ipam/migrations/0072_prefix_cached_relations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
1515
prefix._site_id = prefix.site_id
1616
# Note: Location cannot be set prior to migration
1717

18-
Prefix.objects.bulk_update(prefixes, ['_region', '_site_group', '_site'])
18+
Prefix.objects.bulk_update(prefixes, ['_region', '_site_group', '_site'], batch_size=100)
1919

2020

2121
class Migration(migrations.Migration):

netbox/virtualization/migrations/0045_clusters_cached_relations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
1515
cluster._site_id = cluster.site_id
1616
# Note: Location cannot be set prior to migration
1717

18-
Cluster.objects.bulk_update(clusters, ['_region', '_site_group', '_site'])
18+
Cluster.objects.bulk_update(clusters, ['_region', '_site_group', '_site'], batch_size=100)
1919

2020

2121
class Migration(migrations.Migration):

0 commit comments

Comments
 (0)