aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-12-21 12:02:57 -0600
committerAlex Gleason <alex@alexgleason.me>2021-12-21 12:02:57 -0600
commit304e6baf47e9f578075281e86543c1193008a1dc (patch)
treeb473a36341800205b32529983622dc6f88e80c6d
parent5cd40ad9de12b56e7407097b4d3753470d9e4c66 (diff)
downloadpleroma-304e6baf47e9f578075281e86543c1193008a1dc.tar.gz
mix format
-rw-r--r--priv/repo/migrations/20211218181647_add_activity_fields_to_objects.exs25
1 files changed, 20 insertions, 5 deletions
diff --git a/priv/repo/migrations/20211218181647_add_activity_fields_to_objects.exs b/priv/repo/migrations/20211218181647_add_activity_fields_to_objects.exs
index 8c9fd42d4..d53e514f7 100644
--- a/priv/repo/migrations/20211218181647_add_activity_fields_to_objects.exs
+++ b/priv/repo/migrations/20211218181647_add_activity_fields_to_objects.exs
@@ -14,23 +14,38 @@ defmodule Pleroma.Repo.Migrations.AddActivityFieldsToObjects do
create_if_not_exists(index(:objects, [:local]))
create_if_not_exists(index(:objects, [:actor, "id DESC NULLS LAST"]))
create_if_not_exists(index(:objects, [:recipients], using: :gin))
- create_if_not_exists(index(:objects, ["(data->'to')"], name: :activities_to_index, using: :gin))
- create_if_not_exists(index(:objects, ["(data->'cc')"], name: :activities_cc_index, using: :gin))
+
+ create_if_not_exists(
+ index(:objects, ["(data->'to')"], name: :activities_to_index, using: :gin)
+ )
+
+ create_if_not_exists(
+ index(:objects, ["(data->'cc')"], name: :activities_cc_index, using: :gin)
+ )
# Copy all activities into the newly formatted objects table
execute("INSERT INTO objects (SELECT * FROM activities)")
# Update notifications foreign key
execute("alter table notifications drop constraint notifications_activity_id_fkey")
- execute("alter table notifications add constraint notifications_object_id_fkey foreign key (activity_id) references objects(id) on delete cascade")
+
+ execute(
+ "alter table notifications add constraint notifications_object_id_fkey foreign key (activity_id) references objects(id) on delete cascade"
+ )
# Update bookmarks foreign key
execute("alter table bookmarks drop constraint bookmarks_activity_id_fkey")
- execute("alter table bookmarks add constraint bookmarks_object_id_fkey foreign key (activity_id) references objects(id) on delete cascade")
+
+ execute(
+ "alter table bookmarks add constraint bookmarks_object_id_fkey foreign key (activity_id) references objects(id) on delete cascade"
+ )
# Update report notes foreign key
execute("alter table report_notes drop constraint report_notes_activity_id_fkey")
- execute("alter table report_notes add constraint report_notes_object_id_fkey foreign key (activity_id) references objects(id)")
+
+ execute(
+ "alter table report_notes add constraint report_notes_object_id_fkey foreign key (activity_id) references objects(id)"
+ )
# Nuke the old activities table
execute("drop table activities")