From 7d00e4edbd0bef8791d8efee7665eb13bb256d7a Mon Sep 17 00:00:00 2001
From: Adam Copp <adam.copp@gmail.com>
Date: Tue, 11 Dec 2018 04:30:57 +0000
Subject: Make custom emoji domains case insensitive #9351 (#9474)

* Make custom emoji domains case sensitive #9351

* Fixup style in downcase_domain to comply with codeclimate.

* switch if! to unless

* Don't use transactions, operate in batches.

Also revert spurious schema change.
---
 db/migrate/20181207011115_downcase_custom_emoji_domains.rb | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 db/migrate/20181207011115_downcase_custom_emoji_domains.rb

(limited to 'db/migrate')

diff --git a/db/migrate/20181207011115_downcase_custom_emoji_domains.rb b/db/migrate/20181207011115_downcase_custom_emoji_domains.rb
new file mode 100644
index 000000000..c9db3800d
--- /dev/null
+++ b/db/migrate/20181207011115_downcase_custom_emoji_domains.rb
@@ -0,0 +1,7 @@
+class DowncaseCustomEmojiDomains < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    CustomEmoji.in_batches.update_all('domain = lower(domain)')
+  end
+end
-- 
cgit