Add rake task and timestamped migration file for mysql raw_data MIDIUMTEXT

This commit is contained in:
Shinya Maeda 2018-04-06 21:02:11 +09:00
parent 8a9955cf5c
commit a79cbbd809
4 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,13 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
require Rails.root.join('db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql')
class AddLimitsCiJobTraceChunksRawDataForMysql < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
LimitsCiJobTraceChunksRawDataForMysql.new.up
end
end

View file

@ -0,0 +1,7 @@
class LimitsCiJobTraceChunksRawDataForMysql < ActiveRecord::Migration
def up
return unless Gitlab::Database.mysql?
change_column :ci_job_trace_chunks, :raw_data, :text, limit: 16.megabytes - 1 #MEDIUMTEXT
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180405101928) do
ActiveRecord::Schema.define(version: 20180406204716) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

View file

@ -1,6 +1,7 @@
require Rails.root.join('db/migrate/limits_to_mysql')
require Rails.root.join('db/migrate/markdown_cache_limits_to_mysql')
require Rails.root.join('db/migrate/merge_request_diff_file_limits_to_mysql')
require Rails.root.join('db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql')
desc "GitLab | Add limits to strings in mysql database"
task add_limits_mysql: :environment do
@ -8,4 +9,5 @@ task add_limits_mysql: :environment do
LimitsToMysql.new.up
MarkdownCacheLimitsToMysql.new.up
MergeRequestDiffFileLimitsToMysql.new.up
LimitsCiJobTraceChunksRawDataForMysql.new.up
end