mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Fixes #18438: Specify batch_size for migrations which run bulk_update()
This commit is contained in:
parent
d11deb6678
commit
b913661297
@ -1,4 +1,3 @@
|
|||||||
# Generated by Django 5.0.9 on 2024-10-21 17:34
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
@ -16,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
|
|||||||
termination._site_id = termination.site_id
|
termination._site_id = termination.site_id
|
||||||
# Note: Location cannot be set prior to migration
|
# Note: Location cannot be set prior to migration
|
||||||
|
|
||||||
CircuitTermination.objects.bulk_update(terminations, ['_region', '_site_group', '_site'])
|
CircuitTermination.objects.bulk_update(terminations, ['_region', '_site_group', '_site'], batch_size=100)
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -15,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
|
|||||||
prefix._site_id = prefix.site_id
|
prefix._site_id = prefix.site_id
|
||||||
# Note: Location cannot be set prior to migration
|
# Note: Location cannot be set prior to migration
|
||||||
|
|
||||||
Prefix.objects.bulk_update(prefixes, ['_region', '_site_group', '_site'])
|
Prefix.objects.bulk_update(prefixes, ['_region', '_site_group', '_site'], batch_size=100)
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -15,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
|
|||||||
cluster._site_id = cluster.site_id
|
cluster._site_id = cluster.site_id
|
||||||
# Note: Location cannot be set prior to migration
|
# Note: Location cannot be set prior to migration
|
||||||
|
|
||||||
Cluster.objects.bulk_update(clusters, ['_region', '_site_group', '_site'])
|
Cluster.objects.bulk_update(clusters, ['_region', '_site_group', '_site'], batch_size=100)
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
Loading…
Reference in New Issue
Block a user