Skip to content

Commit 19c4b51

Browse files
trevor-ebillyvg
authored andcommitted
feat(preprod): Add back extras JSONField (#93485)
The final PR in our saga to change the type of `extras` -> `models.JSONField`. This simply adds back the column. See #93466 and #93388
1 parent dac2f51 commit 19c4b51

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

migrations_lockfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ monitors: 0006_add_is_upserting
1919

2020
nodestore: 0001_squashed_0002_nodestore_no_dictfield
2121

22-
preprod: 0003_drop_sentry_jsonfield_actual
22+
preprod: 0004_add_django_jsonfield
2323

2424
replays: 0001_squashed_0005_drop_replay_index
2525

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

src/sentry/preprod/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ def as_choices(cls):
108108
# E.g. 9999
109109
build_number = BoundedBigIntegerField(null=True)
110110

111+
# Miscellaneous fields that we don't need columns for, e.g. enqueue/dequeue times, user-agent, etc.
112+
extras = models.JSONField(null=True)
113+
111114
class Meta:
112115
app_label = "preprod"
113116
db_table = "sentry_preprodartifact"

0 commit comments

Comments
 (0)