diff --git a/migrations_lockfile.txt b/migrations_lockfile.txt index add1c87f81d45c..cda71e6207fa23 100644 --- a/migrations_lockfile.txt +++ b/migrations_lockfile.txt @@ -23,7 +23,7 @@ nodestore: 0001_squashed_0002_nodestore_no_dictfield notifications: 0001_move_notifications_models -preprod: 0010_actual_drop_preprod_artifact_analysis_file_id_col +preprod: 0011_add_preprod_artifact_app_name_and_app_id_fields replays: 0006_add_bulk_delete_job diff --git a/src/sentry/preprod/migrations/0011_add_preprod_artifact_app_name_and_app_id_fields.py b/src/sentry/preprod/migrations/0011_add_preprod_artifact_app_name_and_app_id_fields.py new file mode 100644 index 00000000000000..80eb2798f6db0f --- /dev/null +++ b/src/sentry/preprod/migrations/0011_add_preprod_artifact_app_name_and_app_id_fields.py @@ -0,0 +1,38 @@ +# Generated by Django 5.2.1 on 2025-07-15 18:24 + +from django.db import migrations, models + +from sentry.new_migrations.migrations import CheckedMigration + + +class Migration(CheckedMigration): + # This flag is used to mark that a migration shouldn't be automatically run in production. + # This should only be used for operations where it's safe to run the migration after your + # code has deployed. So this should not be used for most operations that alter the schema + # of a table. + # Here are some things that make sense to mark as post deployment: + # - Large data migrations. Typically we want these to be run manually so that they can be + # monitored and not block the deploy for a long period of time while they run. + # - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to + # run this outside deployments so that we don't block them. Note that while adding an index + # is a schema change, it's completely safe to run the operation after the code has deployed. + # Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment + + is_post_deployment = False + + dependencies = [ + ("preprod", "0010_actual_drop_preprod_artifact_analysis_file_id_col"), + ] + + operations = [ + migrations.AddField( + model_name="preprodartifact", + name="app_id", + field=models.CharField(max_length=255, null=True), + ), + migrations.AddField( + model_name="preprodartifact", + name="app_name", + field=models.CharField(max_length=255, null=True), + ), + ] diff --git a/src/sentry/preprod/models.py b/src/sentry/preprod/models.py index c78f04cdd510c5..5b30f49057cdea 100644 --- a/src/sentry/preprod/models.py +++ b/src/sentry/preprod/models.py @@ -116,6 +116,12 @@ def as_choices(cls): # Installable file like IPA or APK installable_app_file_id = BoundedBigIntegerField(db_index=True, null=True) + # The name of the app, e.g. "My App" + app_name = models.CharField(max_length=255, null=True) + + # The identifier of the app, e.g. "com.myapp.MyApp" + app_id = models.CharField(max_length=255, null=True) + class Meta: app_label = "preprod" db_table = "sentry_preprodartifact"