diff --git a/lib/tasks/migrate/add_limits_mysql.rake b/lib/tasks/migrate/add_limits_mysql.rake new file mode 100644 index 00000000000..7dadfe6164d --- /dev/null +++ b/lib/tasks/migrate/add_limits_mysql.rake @@ -0,0 +1,13 @@ +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: 65535 + change_column :merge_request_diffs, :st_diffs, :text, limit: 65535 + change_column :snippets, :content, :text, limit: 65535 + end +end