Skip to content

Commit 32c22de

Browse files
authored
chore(commits): Remove unused dual write commit tables (#102504)
We're no longer planning on using the dual written tables, so removing these tables. This is the first step, where we remove them from the codebase. <!-- Describe your PR here. -->
1 parent aebacdd commit 32c22de

File tree

4 files changed

+56
-242
lines changed

4 files changed

+56
-242
lines changed

migrations_lockfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ preprod: 0018_add_preprod_artifact_app_icon_id_field
2727

2828
prevent: 0002_alter_integration_id_not_null
2929

30-
releases: 0001_release_models
30+
releases: 0002_delete_dual_written_commit_tables
3131

3232
replays: 0006_add_bulk_delete_job
3333

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Generated by Django 5.2.1 on 2025-10-31 19:01
2+
3+
import django.db.models.deletion
4+
from django.db import migrations
5+
6+
import sentry.db.models.fields.foreignkey
7+
from sentry.new_migrations.migrations import CheckedMigration
8+
from sentry.new_migrations.monkey.models import SafeDeleteModel
9+
from sentry.new_migrations.monkey.state import DeletionAction
10+
11+
12+
class Migration(CheckedMigration):
13+
# This flag is used to mark that a migration shouldn't be automatically run in production.
14+
# This should only be used for operations where it's safe to run the migration after your
15+
# code has deployed. So this should not be used for most operations that alter the schema
16+
# of a table.
17+
# Here are some things that make sense to mark as post deployment:
18+
# - Large data migrations. Typically we want these to be run manually so that they can be
19+
# monitored and not block the deploy for a long period of time while they run.
20+
# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
21+
# run this outside deployments so that we don't block them. Note that while adding an index
22+
# is a schema change, it's completely safe to run the operation after the code has deployed.
23+
# Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment
24+
25+
is_post_deployment = False
26+
27+
dependencies = [
28+
("releases", "0001_release_models"),
29+
("sentry", "1001_prevent_grouphistory_infinte_recursion"),
30+
]
31+
32+
operations = [
33+
migrations.AlterField(
34+
model_name="commit",
35+
name="author",
36+
field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
37+
db_constraint=False,
38+
null=True,
39+
on_delete=django.db.models.deletion.CASCADE,
40+
related_name="releasecommit_set",
41+
to="sentry.commitauthor",
42+
),
43+
),
44+
migrations.AlterField(
45+
model_name="commitfilechange",
46+
name="commit",
47+
field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
48+
db_constraint=False,
49+
on_delete=django.db.models.deletion.CASCADE,
50+
to="releases.commit",
51+
),
52+
),
53+
SafeDeleteModel(name="Commit", deletion_action=DeletionAction.MOVE_TO_PENDING),
54+
SafeDeleteModel(name="CommitFileChange", deletion_action=DeletionAction.MOVE_TO_PENDING),
55+
]

src/sentry/releases/models.py

Lines changed: 0 additions & 125 deletions
This file was deleted.

tests/sentry/releases/test_models.py

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)