Browse Source

ref(indexer): remove use_case_id default (#48972)

We don't want to have a default anymore (and the old default was wrong
anyway so we are backfilling in a different PR)
https://github.com/getsentry/sentry/pull/47940
MeredithAnya 1 year ago
parent
commit
b700f21ba7

+ 1 - 1
migrations_lockfile.txt

@@ -6,5 +6,5 @@ To resolve this, rebase against latest master and regenerate your migration. Thi
 will then be regenerated, and you should be able to merge without conflicts.
 
 nodestore: 0002_nodestore_no_dictfield
-sentry: 0441_remove_unattached_notification_settings
+sentry: 0442_remove_use_case_id_default_perf_indexer
 social_auth: 0001_initial

+ 31 - 0
src/sentry/migrations/0442_remove_use_case_id_default_perf_indexer.py

@@ -0,0 +1,31 @@
+# Generated by Django 2.2.28 on 2023-05-15 18:50
+
+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. For
+    # the most part, 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 dangerous:
+    # - Large data migrations. Typically we want these to be run manually by ops 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
+    #   have ops run this and not block the deploy. Note that while adding an index is a schema
+    #   change, it's completely safe to run the operation after the code has deployed.
+    is_dangerous = False
+
+    dependencies = [
+        ("sentry", "0441_remove_unattached_notification_settings"),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name="perfstringindexer",
+            name="use_case_id",
+            field=models.CharField(max_length=120),
+        ),
+    ]

+ 1 - 1
src/sentry/sentry_metrics/indexer/postgres/models.py

@@ -70,7 +70,7 @@ class StringIndexer(BaseIndexer):
 @region_silo_only_model
 class PerfStringIndexer(BaseIndexer):
     __include_in_export__ = False
-    use_case_id = models.CharField(default="performance", max_length=120)
+    use_case_id = models.CharField(max_length=120)
 
     class Meta:
         db_table = "sentry_perfstringindexer"