about summary refs log tree commit diff
path: root/db/migrate/20200920084007_backfill_custom_emoji_ownership.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20200920084007_backfill_custom_emoji_ownership.rb')
-rw-r--r--db/migrate/20200920084007_backfill_custom_emoji_ownership.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20200920084007_backfill_custom_emoji_ownership.rb b/db/migrate/20200920084007_backfill_custom_emoji_ownership.rb
new file mode 100644
index 000000000..1542bdb5e
--- /dev/null
+++ b/db/migrate/20200920084007_backfill_custom_emoji_ownership.rb
@@ -0,0 +1,12 @@
+class BackfillCustomEmojiOwnership < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    site_contact = Account.site_contact
+    CustomEmoji.local.in_batches.update_all(account_id: site_contact.id)
+  end
+
+  def down
+    nil
+  end
+end