mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 10:56:22 +00:00
18 lines
489 B
Ruby
18 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
|