BigW Consortium Gitlab

Commit 2a99f184 by Dmitriy Zaporozhets

Merge branch 'mysql_field_limits' into 'master'

Adjust MySQL limits for existing installations
parents f5b88710 acebfdc7
v 6.9.0
- Store Rails cache data in the Redis `cache:gitlab` namespace
- Adjust MySQL limits for existing installations
v 6.8.0 v 6.8.0
- Ability to at mention users that are participating in issue and merge req. discussion - Ability to at mention users that are participating in issue and merge req. discussion
- 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) - 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
- Fix download link for huge MR diffs - Fix download link for huge MR diffs
- Expose event and mergerequest timestamps in API - Expose event and mergerequest timestamps in API
- Fix emails on push service when only one commit is pushed - Fix emails on push service when only one commit is pushed
- Store Rails cache data in the Redis `cache:gitlab` namespace
v 6.7.3 v 6.7.3
- Fix the merge notification email not being sent (Pierre de La Morinerie) - Fix the merge notification email not being sent (Pierre de La Morinerie)
......
require_relative 'limits_to_mysql'
class LimitsToMysql < ActiveRecord::Migration
def up
return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
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
...@@ -15,14 +15,7 @@ namespace :gitlab do ...@@ -15,14 +15,7 @@ namespace :gitlab do
end end
Rake::Task["db:setup"].invoke Rake::Task["db:setup"].invoke
config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]
success = case config["adapter"]
when /^mysql/ then
Rake::Task["add_limits_mysql"].invoke Rake::Task["add_limits_mysql"].invoke
when "postgresql" then
end
Rake::Task["db:seed_fu"].invoke Rake::Task["db:seed_fu"].invoke
rescue Gitlab::TaskAbortedByUserError rescue Gitlab::TaskAbortedByUserError
puts "Quitting...".red puts "Quitting...".red
......
require Rails.root.join('db/migrate/limits_to_mysql')
desc "GITLAB | Add limits to strings in mysql database" desc "GITLAB | Add limits to strings in mysql database"
task add_limits_mysql: :environment do task add_limits_mysql: :environment do
puts "Adding limits to schema.rb for mysql" puts "Adding limits to schema.rb for mysql"
LimitsToMysql.new.up LimitsToMysql.new.up
end 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment