migration: only care about Create activities
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 25 Mar 2019 02:56:13 +0000 (02:56 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 15 May 2019 15:54:10 +0000 (15:54 +0000)
priv/repo/migrations/20190324222404_add_thread_visibility_function.exs

index cea0322e71f22629d618c7945716a6393187ec25..11aa47e83c44d934bcdc532e7b3d2298af76b261 100644 (file)
@@ -25,6 +25,11 @@ defmodule Pleroma.Repo.Migrations.AddThreadVisibilityFunction do
           RETURN true;
         END IF;
 
+        --- We only care about Create activities.
+        IF activity.data->>'type' != 'Create' THEN
+          RETURN true;
+        END IF;
+
         --- Normalize the child object into child.
         SELECT * INTO child FROM objects
         INNER JOIN activities ON COALESCE(activities.data->'object'->>'id', activities.data->>'object') = objects.data->>'id'