diff --git a/CHANGELOG b/CHANGELOG index 25067d3abe259b955bd8dab420b465358d1e27ca..7c177b3139a9540183c81aca7caeadcb2f878a3c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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) diff --git a/db/migrate/20140415124820_limits_to_mysql.rb b/db/migrate/20140415124820_limits_to_mysql.rb new file mode 100644 index 0000000000000000000000000000000000000000..3f6e62617c57ab82367fafd407c89815c504c34d --- /dev/null +++ b/db/migrate/20140415124820_limits_to_mysql.rb @@ -0,0 +1 @@ +require_relative 'limits_to_mysql' diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb new file mode 100644 index 0000000000000000000000000000000000000000..4dc3b830bc6c87bc49f2d154c63609a7a49a83e4 --- /dev/null +++ b/db/migrate/limits_to_mysql.rb @@ -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 diff --git a/lib/tasks/migrate/add_limits_mysql.rake b/lib/tasks/migrate/add_limits_mysql.rake index 46b6451752b5bca5de8a756094e05d796434cf23..a1972a682d8512766e8dd6b6c6d24ab44c812461 100644 --- a/lib/tasks/migrate/add_limits_mysql.rake +++ b/lib/tasks/migrate/add_limits_mysql.rake @@ -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