2017-05-10 08:02:21 +02:00
|
|
|
# Generated by Django 1.10.5 on 2017-05-10 05:59
|
|
|
|
from django.db import migrations
|
2020-04-27 07:19:08 +02:00
|
|
|
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
|
2017-05-10 08:02:21 +02:00
|
|
|
from django.db.migrations.state import StateApps
|
|
|
|
|
2020-01-14 21:59:46 +01:00
|
|
|
|
2017-10-26 11:36:30 +02:00
|
|
|
def delete_old_scheduled_jobs(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
|
2017-05-10 08:02:21 +02:00
|
|
|
"""Delete any old scheduled jobs, to handle changes in the format of
|
|
|
|
that table. 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.
|
|
|
|
"""
|
|
|
|
ScheduledJob = apps.get_model('zerver', 'ScheduledJob')
|
|
|
|
ScheduledJob.objects.all().delete()
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
('zerver', '0078_service'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.RunPython(delete_old_scheduled_jobs),
|
|
|
|
]
|