about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorAdam Copp <adam.copp@gmail.com>2018-12-11 04:30:57 +0000
committerEugen Rochko <eugen@zeonfederated.com>2018-12-11 05:30:57 +0100
commit7d00e4edbd0bef8791d8efee7665eb13bb256d7a (patch)
tree1946b862acc6b02b3fbaf670690f196f81f74ea5 /db/migrate
parentdbb1ee269fa4a6ee097dfea5f77bb2c9428af93b (diff)
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.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20181207011115_downcase_custom_emoji_domains.rb7
1 files changed, 7 insertions, 0 deletions
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