diff --git a/migrations_lockfile.txt b/migrations_lockfile.txt index f1490dbb61da7e..a58cb9f10ee301 100644 --- a/migrations_lockfile.txt +++ b/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: 0443_check_notification_team_or_user +sentry: 0444_remove_next_checkin_last_checkin_from_monitor social_auth: 0001_initial diff --git a/src/sentry/migrations/0444_remove_next_checkin_last_checkin_from_monitor.py b/src/sentry/migrations/0444_remove_next_checkin_last_checkin_from_monitor.py new file mode 100644 index 00000000000000..6370ddf2f29cc3 --- /dev/null +++ b/src/sentry/migrations/0444_remove_next_checkin_last_checkin_from_monitor.py @@ -0,0 +1,42 @@ +# Generated by Django 2.2.28 on 2023-05-15 20:15 + +from django.db import migrations + +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", "0443_check_notification_team_or_user"), + ] + + operations = [ + migrations.SeparateDatabaseAndState( + state_operations=[ + migrations.RemoveField( + model_name="monitor", + name="next_checkin", + ), + migrations.RemoveField( + model_name="monitor", + name="last_checkin", + ), + migrations.AlterIndexTogether( + name="monitor", + index_together=set(), + ), + ] + ) + ] diff --git a/src/sentry/monitors/models.py b/src/sentry/monitors/models.py index e2b73d384bb75e..68039f4f8b633f 100644 --- a/src/sentry/monitors/models.py +++ b/src/sentry/monitors/models.py @@ -217,14 +217,11 @@ class Monitor(Model): choices=[(k, str(v)) for k, v in MonitorType.as_choices()], ) config = JSONField(default=dict) - next_checkin = models.DateTimeField(null=True) - last_checkin = models.DateTimeField(null=True) date_added = models.DateTimeField(default=timezone.now) class Meta: app_label = "sentry" db_table = "sentry_monitor" - index_together = (("type", "next_checkin"),) unique_together = (("organization_id", "slug"),) __repr__ = sane_repr("guid", "project_id", "name")