Commit 7880589d authored by Valery Sizov's avatar Valery Sizov Committed by Dmitriy Zaporozhets

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
parent 99976128
# 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment