Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
# 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

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):
Expand Down
Loading