diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-04 14:56:21 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-04 14:56:21 +0200 |
commit | 82ada5d3047237d9e055c43aca7dc7e98d0f2f71 (patch) | |
tree | db122a2411bc1bc03f7797bb78958af51bea8a20 | |
parent | d699a48d554945a3ea66044237840313beef35c5 (diff) | |
download | gitlab-ce-82ada5d3047237d9e055c43aca7dc7e98d0f2f71.tar.gz |
Fix mysql2 query size
-rw-r--r-- | db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb | 17 | ||||
-rw-r--r-- | db/migrate/prometheus_metrics_limits_to_mysql.rb | 12 |
2 files changed, 29 insertions, 0 deletions
diff --git a/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb b/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb new file mode 100644 index 00000000000..b8b08222d66 --- /dev/null +++ b/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# 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/prometheus_metrics_limits_to_mysql') + +class FixPrometheusMetricQueryLimits < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + def up + PrometheusMetricsLimitsToMysql.new.up + end + + def down + # no-op + end +end diff --git a/db/migrate/prometheus_metrics_limits_to_mysql.rb b/db/migrate/prometheus_metrics_limits_to_mysql.rb new file mode 100644 index 00000000000..79f4ab9b64b --- /dev/null +++ b/db/migrate/prometheus_metrics_limits_to_mysql.rb @@ -0,0 +1,12 @@ +class PrometheusMetricsLimitsToMysql < ActiveRecord::Migration + DOWNTIME = false + + def up + return unless Gitlab::Database.mysql? + + change_column :prometheus_metrics, :query, :text, limit: 4096, default: nil + end + + def down + end +end |