diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-04-17 14:31:53 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-04-17 14:31:53 +0900 |
commit | d5740846f6622995302036ac822b758da60f2ba3 (patch) | |
tree | df8cabd3c65cf28cc357382beb7f2401e33b1787 /db | |
parent | 23634e45678b13954fc00fd4e57425ff5cb559aa (diff) | |
download | gitlab-ce-d5740846f6622995302036ac822b758da60f2ba3.tar.gz |
Sanitize migration file. Added a comment on LimitsCiJobTraceChunksRawDataForMysql
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180326202229_create_ci_job_trace_chunks.rb | 4 | ||||
-rw-r--r-- | db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/db/migrate/20180326202229_create_ci_job_trace_chunks.rb b/db/migrate/20180326202229_create_ci_job_trace_chunks.rb index e9f43eaf67f..abfaea9f54a 100644 --- a/db/migrate/20180326202229_create_ci_job_trace_chunks.rb +++ b/db/migrate/20180326202229_create_ci_job_trace_chunks.rb @@ -8,9 +8,7 @@ class CreateCiJobTraceChunks < ActiveRecord::Migration t.integer :job_id, null: false t.integer :chunk_index, null: false t.integer :data_store, null: false - # Mysql needs MEDIUMTEXT type (up to 16MB) rather than TEXT (up to 64KB) - # Because 'raw_data' is always capped by Ci::JobTraceChunk::CHUNK_SIZE, which is 128KB - t.text :raw_data, limit: 16.megabytes - 1 + t.text :raw_data t.foreign_key :ci_builds, column: :job_id, on_delete: :cascade t.index [:job_id, :chunk_index], unique: true diff --git a/db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb b/db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb index 64088efa70b..5e307ce73c9 100644 --- a/db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb +++ b/db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb @@ -2,6 +2,8 @@ class LimitsCiJobTraceChunksRawDataForMysql < ActiveRecord::Migration def up return unless Gitlab::Database.mysql? + # Mysql needs MEDIUMTEXT type (up to 16MB) rather than TEXT (up to 64KB) + # Because 'raw_data' is always capped by Ci::JobTraceChunk::CHUNK_SIZE, which is 128KB change_column :ci_job_trace_chunks, :raw_data, :text, limit: 16.megabytes - 1 #MEDIUMTEXT end end |