diff --git a/engine/apps/alerts/migrations/0028_drop_alertreceivechannel_restricted_at.py b/engine/apps/alerts/migrations/0028_drop_alertreceivechannel_restricted_at.py new file mode 100644 index 00000000..3fe8f97c --- /dev/null +++ b/engine/apps/alerts/migrations/0028_drop_alertreceivechannel_restricted_at.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.20 on 2023-07-26 06:41 + +from django.db import migrations +import django_migration_linter as linter + + +class Migration(migrations.Migration): + + dependencies = [ + ("alerts", "0027_remove_alertreceivechannel_restricted_at_from_state"), + ] + + operations = [ + linter.IgnoreMigration(), + migrations.RunSQL( + sql="ALTER TABLE alerts_alertreceivechannel DROP COLUMN restricted_at", + reverse_sql="ALTER TABLE alerts_alertreceivechannel ADD COLUMN restricted_at datetime(6) NULL" + ) + ] diff --git a/engine/apps/alerts/models/alert_receive_channel.py b/engine/apps/alerts/models/alert_receive_channel.py index 1ee7ba84..5041a873 100644 --- a/engine/apps/alerts/models/alert_receive_channel.py +++ b/engine/apps/alerts/models/alert_receive_channel.py @@ -198,12 +198,6 @@ class AlertReceiveChannel(IntegrationOptionsMixin, MaintainableObject): rate_limited_in_slack_at = models.DateTimeField(null=True, default=None) rate_limit_message_task_id = models.CharField(max_length=100, null=True, default=None) - # TODO: in a subsequent release, write a manual django migration to run the following - # migrations.RunSQL( - # sql = "ALTER TABLE alerts_alertreceivechannel DROP COLUMN restricted_at", - # reverse_sql = migrations.RunSQL.noop - # ) - class Meta: constraints = [ models.UniqueConstraint(