Skip to content

Commit 22ccc46

Browse files
ref(releases): safe remove new_group column from release model (#88046)
1 parent c2964b5 commit 22ccc46

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

migrations_lockfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ remote_subscriptions: 0003_drop_remote_subscription
1717

1818
replays: 0004_index_together
1919

20-
sentry: 0850_crons_drop_location
20+
sentry: 0851_new_group_nullable
2121

2222
social_auth: 0002_default_auto_field
2323

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

src/sentry/models/release.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ class Release(Model):
207207
date_released = models.DateTimeField(null=True, blank=True)
208208
# arbitrary data recorded with the release
209209
data = JSONField(default={})
210-
# Deprecated, in favor of ReleaseProject new_groups field
211-
new_groups = BoundedPositiveIntegerField(default=0)
212210
# generally the release manager, or the person initiating the process
213211
owner_id = HybridCloudForeignKey("sentry.User", on_delete="SET_NULL", null=True, blank=True)
214212

0 commit comments

Comments
 (0)