Commit 43e77099d86960401013a45f56e29bfb83368d2c
1 parent
7fab63b4
Exists in
spb-stable
and in
2 other branches
Adjust MySQL limits for existing installations
Showing
4 changed files
with
14 additions
and
9 deletions
Show diff stats
CHANGELOG
| @@ -18,6 +18,7 @@ v 6.8.0 | @@ -18,6 +18,7 @@ v 6.8.0 | ||
| 18 | - Expose event and mergerequest timestamps in API | 18 | - Expose event and mergerequest timestamps in API |
| 19 | - Fix emails on push service when only one commit is pushed | 19 | - Fix emails on push service when only one commit is pushed |
| 20 | - Store Rails cache data in the Redis `cache:gitlab` namespace | 20 | - Store Rails cache data in the Redis `cache:gitlab` namespace |
| 21 | + - Adjust MySQL limits for existing installations | ||
| 21 | 22 | ||
| 22 | v 6.7.3 | 23 | v 6.7.3 |
| 23 | - Fix the merge notification email not being sent (Pierre de La Morinerie) | 24 | - Fix the merge notification email not being sent (Pierre de La Morinerie) |
| @@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
| 1 | +require_relative 'limits_to_mysql' |
| @@ -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'] == 'mysql2' | ||
| 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/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 |