|
| 1 | +# Generated by Django 5.2.1 on 2025-05-19 18:16 |
| 2 | + |
| 3 | +import django.db.models.functions.text |
| 4 | +from django.db import migrations |
| 5 | + |
| 6 | +import sentry.db.models.indexes |
| 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", "0900_group_link_group_id_no_index"), |
| 27 | + ] |
| 28 | + |
| 29 | + operations = [ |
| 30 | + migrations.SeparateDatabaseAndState( |
| 31 | + state_operations=[ |
| 32 | + migrations.RemoveIndex( |
| 33 | + model_name="organization", |
| 34 | + name="organization_slug_upper_idx", |
| 35 | + ), |
| 36 | + migrations.AddIndex( |
| 37 | + model_name="organization", |
| 38 | + index=sentry.db.models.indexes.IndexWithPostgresNameLimits( |
| 39 | + django.db.models.functions.text.Upper("slug"), |
| 40 | + name="sentry_organization_slug_upper_idx", |
| 41 | + ), |
| 42 | + ), |
| 43 | + ] |
| 44 | + ), |
| 45 | + ] |
0 commit comments