diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-05 20:58:08 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-05 20:58:08 +0300 |
commit | d0f59cd5b3376c6c5a1e449cac26f0d795c3b717 (patch) | |
tree | 4f5c6da894b56e4104d43889e3afcea6f15b68f8 /lib | |
parent | 9bcf03cde0e93d14fd0660ba871655219a7e1bef (diff) | |
download | gitlab-ci-d0f59cd5b3376c6c5a1e449cac26f0d795c3b717.tar.gz |
Add mysql limits to separate rake task
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/add_limits_mysql.rake | 14 | ||||
-rw-r--r-- | lib/tasks/setup.rake | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/tasks/add_limits_mysql.rake b/lib/tasks/add_limits_mysql.rake new file mode 100644 index 0000000..0025702 --- /dev/null +++ b/lib/tasks/add_limits_mysql.rake @@ -0,0 +1,14 @@ +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 + return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/ + + change_column :builds, :trace, :text, limit: 2147483647 + change_column :builds, :push_data, :text, limit: 2147483647 + end +end diff --git a/lib/tasks/setup.rake b/lib/tasks/setup.rake new file mode 100644 index 0000000..2d0882b --- /dev/null +++ b/lib/tasks/setup.rake @@ -0,0 +1,9 @@ +desc "GitLab | Setup gitlab db" +task :setup do + setup_db +end + +def setup_db + Rake::Task["db:setup"].invoke + Rake::Task["add_limits_mysql"].invoke +end |