diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-24 17:37:38 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-24 17:37:38 +0000 |
commit | 2a99f18478797c67e0b795d71688bd06153abe5a (patch) | |
tree | ea6c8d150ebd38722fe6ceb20625e106686157b7 /lib | |
parent | f5b88710ea79463a5f353e6df9911b34c58fac14 (diff) | |
parent | acebfdc7b12a849bef055fa53d0f278318bdad72 (diff) | |
download | gitlab-ce-2a99f18478797c67e0b795d71688bd06153abe5a.tar.gz |
Merge branch 'mysql_field_limits' into 'master'
Adjust MySQL limits for existing installations
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/setup.rake | 9 | ||||
-rw-r--r-- | lib/tasks/migrate/add_limits_mysql.rake | 11 |
2 files changed, 3 insertions, 17 deletions
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake index 853994dd67d..8b4ccdfc3fe 100644 --- a/lib/tasks/gitlab/setup.rake +++ b/lib/tasks/gitlab/setup.rake @@ -15,14 +15,7 @@ namespace :gitlab do end 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 - when "postgresql" then - end - + Rake::Task["add_limits_mysql"].invoke Rake::Task["db:seed_fu"].invoke rescue Gitlab::TaskAbortedByUserError puts "Quitting...".red diff --git a/lib/tasks/migrate/add_limits_mysql.rake b/lib/tasks/migrate/add_limits_mysql.rake index 46b6451752b..a1972a682d8 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 |