|
| 1 | +# Generated by Django 3.2.20 on 2023-09-18 23:09 |
| 2 | + |
| 3 | +import django.db.models.deletion |
| 4 | +import django.utils.timezone |
| 5 | +from django.db import migrations, models |
| 6 | + |
| 7 | +import sentry.db.models.fields.bounded |
| 8 | +import sentry.db.models.fields.foreignkey |
| 9 | +from sentry.new_migrations.migrations import CheckedMigration |
| 10 | + |
| 11 | + |
| 12 | +class Migration(CheckedMigration): |
| 13 | + # This flag is used to mark that a migration shouldn't be automatically run in production. For |
| 14 | + # the most part, this should only be used for operations where it's safe to run the migration |
| 15 | + # after your code has deployed. So this should not be used for most operations that alter the |
| 16 | + # schema of a table. |
| 17 | + # Here are some things that make sense to mark as dangerous: |
| 18 | + # - Large data migrations. Typically we want these to be run manually by ops so that they can |
| 19 | + # be monitored and not block the deploy for a long period of time while they run. |
| 20 | + # - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to |
| 21 | + # have ops run this and not block the deploy. Note that while adding an index is a schema |
| 22 | + # change, it's completely safe to run the operation after the code has deployed. |
| 23 | + is_dangerous = False |
| 24 | + |
| 25 | + dependencies = [ |
| 26 | + ("sentry", "0559_custom_dynamic_sampling_rule"), |
| 27 | + ] |
| 28 | + |
| 29 | + operations = [ |
| 30 | + migrations.CreateModel( |
| 31 | + name="MonitorIncident", |
| 32 | + fields=[ |
| 33 | + ( |
| 34 | + "id", |
| 35 | + sentry.db.models.fields.bounded.BoundedBigAutoField( |
| 36 | + primary_key=True, serialize=False |
| 37 | + ), |
| 38 | + ), |
| 39 | + ("starting_timestamp", models.DateTimeField(null=True)), |
| 40 | + ("resolving_timestamp", models.DateTimeField(null=True)), |
| 41 | + ("grouphash", models.CharField(max_length=32)), |
| 42 | + ("date_added", models.DateTimeField(default=django.utils.timezone.now)), |
| 43 | + ( |
| 44 | + "monitor", |
| 45 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 46 | + on_delete=django.db.models.deletion.CASCADE, to="sentry.monitor" |
| 47 | + ), |
| 48 | + ), |
| 49 | + ( |
| 50 | + "monitor_environment", |
| 51 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 52 | + on_delete=django.db.models.deletion.CASCADE, to="sentry.monitorenvironment" |
| 53 | + ), |
| 54 | + ), |
| 55 | + ( |
| 56 | + "resolving_checkin", |
| 57 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 58 | + null=True, |
| 59 | + on_delete=django.db.models.deletion.CASCADE, |
| 60 | + related_name="resolved_incidents", |
| 61 | + to="sentry.monitorcheckin", |
| 62 | + ), |
| 63 | + ), |
| 64 | + ( |
| 65 | + "starting_checkin", |
| 66 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 67 | + null=True, |
| 68 | + on_delete=django.db.models.deletion.CASCADE, |
| 69 | + related_name="created_incidents", |
| 70 | + to="sentry.monitorcheckin", |
| 71 | + ), |
| 72 | + ), |
| 73 | + ], |
| 74 | + options={ |
| 75 | + "db_table": "sentry_monitorincident", |
| 76 | + }, |
| 77 | + ), |
| 78 | + ] |
0 commit comments