Commit 2a99f18478797c67e0b795d71688bd06153abe5a

Authored by Dmitriy Zaporozhets
2 parents f5b88710 acebfdc7

Merge branch 'mysql_field_limits' into 'master'

Adjust MySQL limits for existing installations
  1 +v 6.9.0
  2 + - Store Rails cache data in the Redis `cache:gitlab` namespace
  3 + - Adjust MySQL limits for existing installations
  4 +
1 v 6.8.0 5 v 6.8.0
2 - Ability to at mention users that are participating in issue and merge req. discussion 6 - Ability to at mention users that are participating in issue and merge req. discussion
3 - Enabled GZip Compression for assets in example Nginx, make sure that Nginx is compiled with --with-http_gzip_static_module flag (this is default in Ubuntu) 7 - Enabled GZip Compression for assets in example Nginx, make sure that Nginx is compiled with --with-http_gzip_static_module flag (this is default in Ubuntu)
@@ -17,7 +21,6 @@ v 6.8.0 @@ -17,7 +21,6 @@ v 6.8.0
17 - Fix download link for huge MR diffs 21 - Fix download link for huge MR diffs
18 - Expose event and mergerequest timestamps in API 22 - Expose event and mergerequest timestamps in API
19 - Fix emails on push service when only one commit is pushed 23 - Fix emails on push service when only one commit is pushed
20 - - Store Rails cache data in the Redis `cache:gitlab` namespace  
21 24
22 v 6.7.3 25 v 6.7.3
23 - Fix the merge notification email not being sent (Pierre de La Morinerie) 26 - Fix the merge notification email not being sent (Pierre de La Morinerie)
db/migrate/20140415124820_limits_to_mysql.rb 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +require_relative 'limits_to_mysql'
db/migrate/limits_to_mysql.rb 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +class LimitsToMysql < ActiveRecord::Migration
  2 + def up
  3 + return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
  4 +
  5 + change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647
  6 + change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647
  7 + change_column :snippets, :content, :text, limit: 2147483647
  8 + change_column :notes, :st_diff, :text, limit: 2147483647
  9 + end
  10 +end
lib/tasks/gitlab/setup.rake
@@ -15,14 +15,7 @@ namespace :gitlab do @@ -15,14 +15,7 @@ namespace :gitlab do
15 end 15 end
16 16
17 Rake::Task["db:setup"].invoke 17 Rake::Task["db:setup"].invoke
18 -  
19 - config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]  
20 - success = case config["adapter"]  
21 - when /^mysql/ then  
22 - Rake::Task["add_limits_mysql"].invoke  
23 - when "postgresql" then  
24 - end  
25 - 18 + Rake::Task["add_limits_mysql"].invoke
26 Rake::Task["db:seed_fu"].invoke 19 Rake::Task["db:seed_fu"].invoke
27 rescue Gitlab::TaskAbortedByUserError 20 rescue Gitlab::TaskAbortedByUserError
28 puts "Quitting...".red 21 puts "Quitting...".red
lib/tasks/migrate/add_limits_mysql.rake
  1 +require Rails.root.join('db/migrate/limits_to_mysql')
  2 +
1 desc "GITLAB | Add limits to strings in mysql database" 3 desc "GITLAB | Add limits to strings in mysql database"
2 task add_limits_mysql: :environment do 4 task add_limits_mysql: :environment do
3 puts "Adding limits to schema.rb for mysql" 5 puts "Adding limits to schema.rb for mysql"
4 LimitsToMysql.new.up 6 LimitsToMysql.new.up
5 end 7 end
6 -  
7 -class LimitsToMysql < ActiveRecord::Migration  
8 - def up  
9 - change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647  
10 - change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647  
11 - change_column :snippets, :content, :text, limit: 2147483647  
12 - change_column :notes, :st_diff, :text, limit: 2147483647  
13 - end  
14 -end