mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 15:46:21 +00:00
17 lines
439 B
Ruby
17 lines
439 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Relaciona instancias con sus actividades
|
||
|
class AddInstanceIdToActivityPubs < ActiveRecord::Migration[6.1]
|
||
|
def up
|
||
|
add_column :activity_pubs, :instance_id, :uuid, index: true
|
||
|
|
||
|
ActivityPub.all.find_each do |activity_pub|
|
||
|
activity_pub.update(instance: activity_pub&.object&.actor&.instance)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
remove_column :activity_pubs, :instance_id, :uuid, index: true
|
||
|
end
|
||
|
end
|