Skip to content

Commit 3f732ce

Browse files
iamrajjoshiandrewshie-sentry
authored andcommitted
🔧 chore(data-secrecy v2): prep DataSecrecyWaiver model to be deleted (#95393)
1 parent 703019a commit 3f732ce

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

‎migrations_lockfile.txt

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

2828
replays: 0006_add_bulk_delete_job
2929

30-
sentry: 0947_add_dashboard_last_visited_model
30+
sentry: 0948_ds_waiver_org_fk_not_db_constr
3131

3232
social_auth: 0003_social_auth_json_field
3333

‎src/sentry/data_secrecy/models/datasecrecywaiver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class DataSecrecyWaiver(DefaultFieldsModelExisting):
1111
__relocation_scope__ = RelocationScope.Organization
1212

13-
organization = FlexibleForeignKey("sentry.Organization", unique=True)
13+
organization = FlexibleForeignKey("sentry.Organization", unique=True, db_constraint=False)
1414
access_start = models.DateTimeField(default=timezone.now)
1515
access_end = models.DateTimeField(default=timezone.now)
1616
zendesk_tickets = ArrayField(models.TextField(), default=list)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Generated by Django 5.2.1 on 2025-07-11 23:13
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+
9+
10+
class Migration(CheckedMigration):
11+
# This flag is used to mark that a migration shouldn't be automatically run in production.
12+
# This should only be used for operations where it's safe to run the migration after your
13+
# code has deployed. So this should not be used for most operations that alter the schema
14+
# of a table.
15+
# Here are some things that make sense to mark as post deployment:
16+
# - Large data migrations. Typically we want these to be run manually so that they can be
17+
# monitored and not block the deploy for a long period of time while they run.
18+
# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
19+
# run this outside deployments so that we don't block them. Note that while adding an index
20+
# is a schema change, it's completely safe to run the operation after the code has deployed.
21+
# Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment
22+
23+
is_post_deployment = False
24+
25+
dependencies = [
26+
("sentry", "0947_add_dashboard_last_visited_model"),
27+
]
28+
29+
operations = [
30+
migrations.AlterField(
31+
model_name="datasecrecywaiver",
32+
name="organization",
33+
field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
34+
db_constraint=False,
35+
on_delete=django.db.models.deletion.CASCADE,
36+
to="sentry.organization",
37+
unique=True,
38+
),
39+
),
40+
]

0 commit comments

Comments
 (0)