Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-05-08 11:29:07 +0300
committerValery Sizov <valery@gitlab.com>2015-05-08 11:29:07 +0300
commitd881345ed71b05d404d277624556a438064f09cd (patch)
treefd9e782104d118b8c2379dee9d9fc04696f87f33 /db
parente1727f608b7ccc3ac2c4bf55ca96e4b811ed851a (diff)
parent548cec6ea46f0d66a60b564b2b72281b3c800fdd (diff)
Merge branch 'fix-mysql-migration-with-tags' into 'master'
Change the MySQL collation type to utf8_bin to ensure case-sensitive tags are supported MySQL tables had a collation type of utf8_ci, which makes the name case-insensitive. Previously this migration was run only after indices were built, but it needs to happen before if there is existing data that is case-sensitive. This is an idempotent change, so applying it again in the existing migration (20150425164651) should not change anything. This is related to !623, but this migration should run before that one. * Closes #1589 * Closes https://github.com/gitlabhq/gitlabhq/issues/9255 See merge request !625
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