diff --git a/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py b/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py index e3bdf5a3406ce0..1ae640319f2964 100644 --- a/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py +++ b/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py @@ -1,5 +1,7 @@ # Generated by Django 5.2.8 on 2025-11-24 19:57 +import logging + from django.db import migrations from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.migrations.state import StateApps @@ -7,16 +9,28 @@ from sentry.new_migrations.migrations import CheckedMigration from sentry.utils.query import RangeQuerySetWrapper +logger = logging.getLogger(__name__) + def migrate_fallthrough_type(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None: Action = apps.get_model("workflow_engine", "Action") - for action in RangeQuerySetWrapper(Action.objects.all()): + count = 0 + for action in RangeQuerySetWrapper(Action.objects.filter(type="email")): if "fallthroughType" in action.data: new_data = action.data.copy() del new_data["fallthroughType"] new_data["fallthrough_type"] = action.data["fallthroughType"] action.data = new_data action.save() + count += 1 + if count % 1000 == 0: + logger.info( + "Progress update", + extra={ + "count": count, + "current_action_id": action.id, + }, + ) class Migration(CheckedMigration):