summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-05-07 16:26:45 -0700
committerStan Hu <stanhu@gmail.com>2015-05-07 16:33:11 -0700
commit548cec6ea46f0d66a60b564b2b72281b3c800fdd (patch)
tree7b4e54f29a0fb9c0c8d4ed9d7071b1eb3ff50509 /db
parentc4aa700398173b80131a00a0e7dd3badd454bc22 (diff)
downloadgitlab-ce-548cec6ea46f0d66a60b564b2b72281b3c800fdd.tar.gz
Change the MySQL collation type to utf8_bin to ensure case-sensitive tags are supported
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
new file mode 100644
index 00000000000..281c88d2a7d
--- /dev/null
+++ b/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
@@ -0,0 +1,10 @@
+# This migration is a duplicate of 20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
+# It shold be applied before the index additions to ensure that `name` is case sensitive.
+
+class GitlabChangeCollationForTagNames < ActiveRecord::Migration
+ def up
+ if ActsAsTaggableOn::Utils.using_mysql?
+ execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
+ end
+ end
+end