migration: only care about Create activities

This commit is contained in:
William Pitcock 2019-03-25 02:56:13 +00:00
parent c7644313e7
commit 75ce6adcff
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,11 @@ def up do
RETURN true; RETURN true;
END IF; END IF;
--- We only care about Create activities.
IF activity.data->>'type' != 'Create' THEN
RETURN true;
END IF;
--- Normalize the child object into child. --- Normalize the child object into child.
SELECT * INTO child FROM objects SELECT * INTO child FROM objects
INNER JOIN activities ON COALESCE(activities.data->'object'->>'id', activities.data->>'object') = objects.data->>'id' INNER JOIN activities ON COALESCE(activities.data->'object'->>'id', activities.data->>'object') = objects.data->>'id'