Skip to content

Commit f8a7613

Browse files
authored
chore(aci): pending delete WorkflowFireHistory rollout columns (#91910)
1 parent ae8bc63 commit f8a7613

File tree

3 files changed

+40
-9
lines changed

3 files changed

+40
-9
lines changed

migrations_lockfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ tempest: 0002_make_message_type_nullable
2929

3030
uptime: 0042_extra_uptime_indexes
3131

32-
workflow_engine: 0062_workflow_engine_missing_indexes
32+
workflow_engine: 0063_drop_rollout_workflowfirehistory_columns
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Django 5.2.1 on 2025-05-19 22:35
2+
3+
4+
from sentry.new_migrations.migrations import CheckedMigration
5+
from sentry.new_migrations.monkey.fields import SafeRemoveField
6+
from sentry.new_migrations.monkey.state import DeletionAction
7+
8+
9+
class Migration(CheckedMigration):
10+
# This flag is used to mark that a migration shouldn't be automatically run in production.
11+
# This should only be used for operations where it's safe to run the migration after your
12+
# code has deployed. So this should not be used for most operations that alter the schema
13+
# of a table.
14+
# Here are some things that make sense to mark as post deployment:
15+
# - Large data migrations. Typically we want these to be run manually so that they can be
16+
# monitored and not block the deploy for a long period of time while they run.
17+
# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
18+
# run this outside deployments so that we don't block them. Note that while adding an index
19+
# is a schema change, it's completely safe to run the operation after the code has deployed.
20+
# Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment
21+
22+
is_post_deployment = False
23+
24+
dependencies = [
25+
("workflow_engine", "0062_workflow_engine_missing_indexes"),
26+
]
27+
28+
operations = [
29+
SafeRemoveField(
30+
model_name="workflowfirehistory",
31+
name="has_fired_actions",
32+
deletion_action=DeletionAction.MOVE_TO_PENDING,
33+
),
34+
SafeRemoveField(
35+
model_name="workflowfirehistory",
36+
name="has_passed_filters",
37+
deletion_action=DeletionAction.MOVE_TO_PENDING,
38+
),
39+
]

src/sentry/workflow_engine/models/workflow_fire_history.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from django.db import models
2-
31
from sentry.backup.scopes import RelocationScope
42
from sentry.db.models import CharField, FlexibleForeignKey, region_silo_model, sane_repr
53
from sentry.db.models.base import DefaultFieldsModel
@@ -14,12 +12,6 @@ class WorkflowFireHistory(DefaultFieldsModel):
1412
group = FlexibleForeignKey("sentry.Group", db_constraint=False)
1513
event_id = CharField(max_length=32)
1614
notification_uuid = UUIDField(auto_add=True, unique=True)
17-
has_passed_filters = models.BooleanField(
18-
null=True
19-
) # used for rollout -- whether the workflow passed all filters
20-
has_fired_actions = models.BooleanField(
21-
default=False, db_default=False
22-
) # used for rollout -- whether at least one group of actions was triggered (Rules have 1 group of actions)
2315

2416
class Meta:
2517
db_table = "workflow_engine_workflowfirehistory"

0 commit comments

Comments
 (0)