summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/fix-migration.skip0
-rw-r--r--priv/repo/migrations/20240729163838_publisher_job_change.exs13
2 files changed, 9 insertions, 4 deletions
diff --git a/changelog.d/fix-migration.skip b/changelog.d/fix-migration.skip
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/changelog.d/fix-migration.skip
diff --git a/priv/repo/migrations/20240729163838_publisher_job_change.exs b/priv/repo/migrations/20240729163838_publisher_job_change.exs
index 3449e3b3b..cbea18205 100644
--- a/priv/repo/migrations/20240729163838_publisher_job_change.exs
+++ b/priv/repo/migrations/20240729163838_publisher_job_change.exs
@@ -16,12 +16,17 @@ defmodule Pleroma.Repo.Migrations.PublisherJobChange do
Enum.each(jobs, fn job ->
args = job.args
- activity = Activity.get_by_ap_id(args["id"])
- updated_args = Map.put(args, "activity_id", activity.id)
+ case Activity.get_by_ap_id(args["id"]) do
+ nil ->
+ :ok
- Pleroma.Workers.PublisherWorker.new(updated_args)
- |> Oban.insert()
+ %Activity{id: activity_id} ->
+ updated_args = Map.put(args, "activity_id", activity_id)
+
+ Pleroma.Workers.PublisherWorker.new(updated_args)
+ |> Oban.insert()
+ end
end)
end
end