2017-06-26 19:43:32 +02:00
|
|
|
# Generated by Django 1.10.5 on 2017-05-10 05:59
|
|
|
|
from django.db import migrations
|
2022-05-27 23:33:51 +02:00
|
|
|
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
|
2017-06-26 19:43:32 +02:00
|
|
|
from django.db.migrations.state import StateApps
|
|
|
|
|
2020-01-14 21:59:46 +01:00
|
|
|
|
2022-05-27 23:33:51 +02:00
|
|
|
def delete_old_scheduled_jobs(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
|
2017-06-26 19:43:32 +02:00
|
|
|
"""Delete any old scheduled jobs, to handle changes in the format of
|
|
|
|
send_email. Ideally, we'd translate the jobs, but it's not really
|
|
|
|
worth the development effort to save a few invitation reminders
|
|
|
|
and day2 followup emails.
|
|
|
|
"""
|
2021-02-12 08:20:45 +01:00
|
|
|
ScheduledJob = apps.get_model("zerver", "ScheduledJob")
|
2017-06-26 19:43:32 +02:00
|
|
|
ScheduledJob.objects.all().delete()
|
|
|
|
|
2021-02-12 08:19:30 +01:00
|
|
|
|
2017-06-26 19:43:32 +02:00
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
2021-02-12 08:20:45 +01:00
|
|
|
("zerver", "0086_realm_alter_default_org_type"),
|
2017-06-26 19:43:32 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2020-04-29 08:43:25 +02:00
|
|
|
migrations.RunPython(delete_old_scheduled_jobs, elidable=True),
|
2017-06-26 19:43:32 +02:00
|
|
|
]
|