Adjust MySQL limits for existing installations

This commit is contained in:
Jacob Vosmaer 2014-04-15 16:26:15 +02:00
parent 7fab63b41f
commit 43e77099d8
4 changed files with 14 additions and 9 deletions

View File

@ -18,6 +18,7 @@ v 6.8.0
- Expose event and mergerequest timestamps in API
- Fix emails on push service when only one commit is pushed
- Store Rails cache data in the Redis `cache:gitlab` namespace
- Adjust MySQL limits for existing installations
v 6.7.3
- Fix the merge notification email not being sent (Pierre de La Morinerie)

View File

@ -0,0 +1 @@
require_relative 'limits_to_mysql'

View File

@ -0,0 +1,10 @@
class LimitsToMysql < ActiveRecord::Migration
def up
return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'mysql2'
change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647
change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647
change_column :snippets, :content, :text, limit: 2147483647
change_column :notes, :st_diff, :text, limit: 2147483647
end
end

View File

@ -1,14 +1,7 @@
require Rails.root.join('db/migrate/limits_to_mysql')
desc "GITLAB | Add limits to strings in mysql database"
task add_limits_mysql: :environment do
puts "Adding limits to schema.rb for mysql"
LimitsToMysql.new.up
end
class LimitsToMysql < ActiveRecord::Migration
def up
change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647
change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647
change_column :snippets, :content, :text, limit: 2147483647
change_column :notes, :st_diff, :text, limit: 2147483647
end
end