|
| 1 | +# Generated by Django 3.2.23 on 2023-12-20 19:54 |
| 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. For |
| 10 | + # the most part, this should only be used for operations where it's safe to run the migration |
| 11 | + # after your code has deployed. So this should not be used for most operations that alter the |
| 12 | + # schema of a table. |
| 13 | + # Here are some things that make sense to mark as dangerous: |
| 14 | + # - Large data migrations. Typically we want these to be run manually by ops so that they can |
| 15 | + # be 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 | + # have ops run this and not block the deploy. Note that while adding an index is a schema |
| 18 | + # change, it's completely safe to run the operation after the code has deployed. |
| 19 | + is_dangerous = False |
| 20 | + |
| 21 | + dependencies = [ |
| 22 | + ("sentry", "0623_increase_regression_fingerprint_length"), |
| 23 | + ] |
| 24 | + |
| 25 | + operations = [ |
| 26 | + migrations.SeparateDatabaseAndState( |
| 27 | + database_operations=[ |
| 28 | + migrations.RunSQL( |
| 29 | + """ |
| 30 | + ALTER TABLE "sentry_monitorenvironment" ADD COLUMN "is_muted" boolean NOT NULL DEFAULT FALSE; |
| 31 | + """, |
| 32 | + reverse_sql=""" |
| 33 | + ALTER TABLE "sentry_monitorenvironment" DROP COLUMN "is_muted"; |
| 34 | + """, |
| 35 | + hints={"tables": ["sentry_monitorenvironment"]}, |
| 36 | + ), |
| 37 | + ], |
| 38 | + state_operations=[ |
| 39 | + migrations.AddField( |
| 40 | + model_name="monitorenvironment", |
| 41 | + name="is_muted", |
| 42 | + field=models.BooleanField(default=False), |
| 43 | + ), |
| 44 | + ], |
| 45 | + ) |
| 46 | + ] |
0 commit comments