5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 11:56:21 +00:00
panel/db/migrate/20240307203039_remove_actor_moderations2.rb

14 lines
432 B
Ruby
Raw Normal View History

2024-03-07 20:44:40 +00:00
# frozen_string_literal: true
# Algunes quedaron como genéricxs
class RemoveActorModerations2 < ActiveRecord::Migration[6.1]
def up
2024-03-07 20:46:32 +00:00
actor_uris = ActivityPub::Activity.unscope(:order).where(type: 'ActivityPub::Activity::Delete').distinct.pluck(Arel.sql("content->>'object'"))
2024-03-07 20:44:40 +00:00
actor_ids = ActivityPub::Actor.where(uri: actor_uris).ids
ActorModeration.where(actor_id: actor_ids).remove_all!
end
def down; end
end