about summary refs log tree commit diff
path: root/db/migrate/20190521003909_rewrite_scoped_tag_delims.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20190521003909_rewrite_scoped_tag_delims.rb')
-rw-r--r--db/migrate/20190521003909_rewrite_scoped_tag_delims.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20190521003909_rewrite_scoped_tag_delims.rb b/db/migrate/20190521003909_rewrite_scoped_tag_delims.rb
new file mode 100644
index 000000000..a7b2c0224
--- /dev/null
+++ b/db/migrate/20190521003909_rewrite_scoped_tag_delims.rb
@@ -0,0 +1,9 @@
+class RewriteScopedTagDelims < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+  def up
+    Tag.where("tags.name LIKE '%:%'").find_each do |tag|
+      tag.name.gsub!(':', '.')
+      tag.save
+    end
+  end
+end