0003_auto_20210327_1648.py 629 B

1234567891011121314151617181920212223
  1. # Generated by Django 3.1.7 on 2021-03-27 16:48
  2. from django.db import migrations
  3. def forwards_func(apps, schema_editor):
  4. ProjectAlert = apps.get_model("alerts", "ProjectAlert")
  5. for alert in ProjectAlert.objects.all():
  6. # Assume existing alerts are email
  7. alert.alertrecipient_set.create(recipient_type="email")
  8. class Migration(migrations.Migration):
  9. dependencies = [
  10. ("alerts", "0002_auto_20210314_2022"),
  11. ]
  12. operations = [
  13. migrations.AlterUniqueTogether(
  14. name="alertrecipient",
  15. unique_together={("alert", "recipient_type", "url")},
  16. ),
  17. ]