mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-28 17:16:21 +00:00
19 lines
489 B
Ruby
19 lines
489 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Relaciona Actor con Activity
|
||
|
class AddActorToActivities < ActiveRecord::Migration[6.1]
|
||
|
def up
|
||
|
add_column :activity_pub_activities, :actor_id, :uuid, index: true
|
||
|
|
||
|
ActivityPub::Activity.find_each do |activity|
|
||
|
actor = ActivityPub::Actor.find_by(uri: activity.content['actor'])
|
||
|
|
||
|
activity.update(actor: actor) if actor.present?
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
remove_column :activity_pub_activities, :actor_id, :uuid, index: true
|
||
|
end
|
||
|
end
|