diff --git a/src/documents/migrations/1063_alter_workflowactionwebhook_url_and_more.py b/src/documents/migrations/1063_alter_workflowactionwebhook_url_and_more.py deleted file mode 100644 index 16c1eeb63..000000000 --- a/src/documents/migrations/1063_alter_workflowactionwebhook_url_and_more.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by Django 5.1.6 on 2025-02-20 04:55 - -import multiselectfield.db.fields -from django.db import migrations -from django.db import models - - -# WebUI source was added, so all existing APIUpload sources should be updated to include WebUI -def update_workflow_sources(apps, schema_editor): - WorkflowTrigger = apps.get_model("documents", "WorkflowTrigger") - for trigger in WorkflowTrigger.objects.all(): - sources = list(trigger.sources) - if 2 in sources: - sources.append(4) - trigger.sources = sources - trigger.save() - - -class Migration(migrations.Migration): - dependencies = [ - ("documents", "1062_alter_savedviewfilterrule_rule_type"), - ] - - operations = [ - migrations.AlterField( - model_name="workflowactionwebhook", - name="url", - field=models.CharField( - help_text="The destination URL for the notification.", - max_length=256, - verbose_name="webhook url", - ), - ), - migrations.AlterField( - model_name="workflowtrigger", - name="sources", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - (1, "Consume Folder"), - (2, "Api Upload"), - (3, "Mail Fetch"), - (4, "Web UI"), - ], - default="1,2,3,4", - max_length=7, - ), - ), - migrations.RunPython( - code=update_workflow_sources, - reverse_code=migrations.RunPython.noop, - ), - ] diff --git a/src/documents/migrations/1063_paperlesstask_type_alter_paperlesstask_task_name_and_more.py b/src/documents/migrations/1063_paperlesstask_type_alter_paperlesstask_task_name_and_more.py index a5171d797..506817ead 100644 --- a/src/documents/migrations/1063_paperlesstask_type_alter_paperlesstask_task_name_and_more.py +++ b/src/documents/migrations/1063_paperlesstask_type_alter_paperlesstask_task_name_and_more.py @@ -1,9 +1,21 @@ -# Generated by Django 5.1.6 on 2025-02-17 01:13 +# Generated by Django 5.1.6 on 2025-02-21 16:34 +import multiselectfield.db.fields from django.db import migrations from django.db import models +# WebUI source was added, so all existing APIUpload sources should be updated to include WebUI +def update_workflow_sources(apps, schema_editor): + WorkflowTrigger = apps.get_model("documents", "WorkflowTrigger") + for trigger in WorkflowTrigger.objects.all(): + sources = list(trigger.sources) + if 2 in sources: + sources.append(4) + trigger.sources = sources + trigger.save() + + def make_existing_tasks_consume_auto(apps, schema_editor): PaperlessTask = apps.get_model("documents", "PaperlessTask") PaperlessTask.objects.all().update(type="auto_task", task_name="consume_file") @@ -46,8 +58,8 @@ class Migration(migrations.Migration): ), ), migrations.RunPython( - make_existing_tasks_consume_auto, - migrations.RunPython.noop, + code=make_existing_tasks_consume_auto, + reverse_code=migrations.RunPython.noop, ), migrations.AlterField( model_name="workflowactionwebhook", @@ -58,4 +70,22 @@ class Migration(migrations.Migration): verbose_name="webhook url", ), ), + migrations.AlterField( + model_name="workflowtrigger", + name="sources", + field=multiselectfield.db.fields.MultiSelectField( + choices=[ + (1, "Consume Folder"), + (2, "Api Upload"), + (3, "Mail Fetch"), + (4, "Web UI"), + ], + default="1,2,3,4", + max_length=7, + ), + ), + migrations.RunPython( + code=update_workflow_sources, + reverse_code=migrations.RunPython.noop, + ), ]