Skip to content
Snippets Groups Projects

GPG signed commits

Merged Alexis Reigel requested to merge siemens/gitlab-ce:feature/gpg-signed-commits into master
Compare and Show latest version
1 file
+ 23
0
Compare changes
  • Side-by-side
  • Inline
# This patches ActiveRecord so indexes for binary columns created using the
# MySQL adapter apply a length of 20. Otherwise MySQL can't create an index on
# binary columns.
if defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)
module ActiveRecord
module ConnectionAdapters
class Mysql2Adapter < AbstractMysqlAdapter
alias_method :__gitlab_add_index, :add_index
def add_index(table_name, column_name, options = {})
column = ActiveRecord::Base.connection.columns(table_name).first { |c| c.name == column_name }
if column.type == :binary
options[:length] = 20
end
__gitlab_add_index(table_name, column_name, options)
end
end
end
end
end
Loading