From 0a3f91f220c8e659d92cd6f2598190d49f19b5bd Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Fri, 14 Nov 2025 14:58:38 +0100 Subject: [PATCH] Fix entropy imports --- script/import-sqlite-database.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/script/import-sqlite-database.rb b/script/import-sqlite-database.rb index 4155a985a..38d48304b 100755 --- a/script/import-sqlite-database.rb +++ b/script/import-sqlite-database.rb @@ -48,7 +48,6 @@ class Import ActiveStorage::Attachment.skip_callback(:commit, :after, :purge_dependent_blob_later) Event.suppress do - # copy_entropies copy_users copy_boards copy_accesses @@ -69,6 +68,7 @@ class Import copy_webhooks copy_push_subscriptions copy_filters + copy_entropies end copy_notifications @@ -536,13 +536,11 @@ class Import else next end - Entropy.create!( - container_type: old_entropy.container_type, - container_id: container_id, - auto_postpone_period: old_entropy.auto_postpone_period, - created_at: old_entropy.created_at, - updated_at: old_entropy.updated_at - ) + Entropy.find_or_create_by!(account_id: account.id, container_type: old_entropy.container_type, container_id: container_id) do |entropy| + entropy.auto_postpone_period = old_entropy.auto_postpone_period, + entropy.created_at = old_entropy.created_at, + entropy.updated_at = old_entropy.updated_at + end end end end