diff options
author | Nick Thomas <nick@gitlab.com> | 2019-06-13 16:12:28 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-07-23 18:53:03 +0300 |
commit | 4aa76dddecc048cef24963323afe59f1c120cb72 (patch) | |
tree | 0a15518b73ee1646d09161954cbefb577d249138 /db/migrate | |
parent | d892e80bf0161b535389c91ccb53539e4f08d790 (diff) |
Remove dead MySQL code
None of this code can be reached any more, so it can all be removed
Diffstat (limited to 'db/migrate')
12 files changed, 1 insertions, 126 deletions
diff --git a/db/migrate/20180206200543_reset_events_primary_key_sequence.rb b/db/migrate/20180206200543_reset_events_primary_key_sequence.rb index d395c5725e4..e7a18e68395 100644 --- a/db/migrate/20180206200543_reset_events_primary_key_sequence.rb +++ b/db/migrate/20180206200543_reset_events_primary_key_sequence.rb @@ -12,24 +12,10 @@ class ResetEventsPrimaryKeySequence < ActiveRecord::Migration[4.2] end def up - if Gitlab::Database.postgresql? - reset_primary_key_for_postgresql - else - reset_primary_key_for_mysql - end + reset_pk_sequence!(Event.table_name) end def down # No-op end - - def reset_primary_key_for_postgresql - reset_pk_sequence!(Event.table_name) - end - - def reset_primary_key_for_mysql - amount = Event.pluck('COALESCE(MAX(id), 1)').first - - execute "ALTER TABLE #{Event.table_name} AUTO_INCREMENT = #{amount}" - end end diff --git a/db/migrate/20180403035759_create_project_ci_cd_settings.rb b/db/migrate/20180403035759_create_project_ci_cd_settings.rb index 00028689779..c630dd3c942 100644 --- a/db/migrate/20180403035759_create_project_ci_cd_settings.rb +++ b/db/migrate/20180403035759_create_project_ci_cd_settings.rb @@ -30,12 +30,6 @@ class CreateProjectCiCdSettings < ActiveRecord::Migration[4.2] end def add_foreign_key_with_retry - if Gitlab::Database.mysql? - # When using MySQL we don't support online upgrades, thus projects can't - # be deleted while we are running this migration. - return add_project_id_foreign_key - end - # Between the initial INSERT and the addition of the foreign key some # projects may have been removed, leaving orphaned rows in our new settings # table. diff --git a/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb b/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb deleted file mode 100644 index 0b541e94353..00000000000 --- a/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb +++ /dev/null @@ -1,13 +0,0 @@ -# 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_build_trace_chunks_raw_data_for_mysql') - -class AddLimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration[4.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - LimitsCiBuildTraceChunksRawDataForMysql.new.up - end -end diff --git a/db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb b/db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb deleted file mode 100644 index 08ce8cc3094..00000000000 --- a/db/migrate/20180521171529_increase_mysql_text_limit_for_gpg_keys.rb +++ /dev/null @@ -1 +0,0 @@ -require_relative 'gpg_keys_limits_to_mysql' diff --git a/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb b/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb deleted file mode 100644 index 80c4d11a38e..00000000000 --- a/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb +++ /dev/null @@ -1,19 +0,0 @@ -# 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[4.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - PrometheusMetricsLimitsToMysql.new.up - end - - def down - # no-op - end -end diff --git a/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb b/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb index 2b5cd45e92c..e21eb291282 100644 --- a/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb +++ b/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb @@ -34,10 +34,6 @@ class AddMissingIndexesForForeignKeys < ActiveRecord::Migration[4.2] end def down - # MySQL requires index for FK, - # thus removal of indexes does fail - return if Gitlab::Database.mysql? - remove_concurrent_index(:application_settings, :usage_stats_set_by_user_id) remove_concurrent_index(:ci_pipeline_schedules, :owner_id) remove_concurrent_index(:ci_trigger_requests, :trigger_id) diff --git a/db/migrate/gpg_keys_limits_to_mysql.rb b/db/migrate/gpg_keys_limits_to_mysql.rb deleted file mode 100644 index 2cd347a0463..00000000000 --- a/db/migrate/gpg_keys_limits_to_mysql.rb +++ /dev/null @@ -1,14 +0,0 @@ -class IncreaseMysqlTextLimitForGpgKeys < ActiveRecord::Migration[4.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def up - return unless Gitlab::Database.mysql? - - change_column :gpg_keys, :key, :text, limit: 16.megabytes - 1 - end - - def down - # no-op - end -end diff --git a/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb b/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb deleted file mode 100644 index 92402cf387b..00000000000 --- a/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb +++ /dev/null @@ -1,9 +0,0 @@ -class LimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration[4.2] - 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::BuildTraceChunk::CHUNK_SIZE, which is 128KB - change_column :ci_build_trace_chunks, :raw_data, :binary, limit: 16.megabytes - 1 # MEDIUMTEXT - end -end diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb deleted file mode 100644 index 33cb19aff9e..00000000000 --- a/db/migrate/limits_to_mysql.rb +++ /dev/null @@ -1,8 +0,0 @@ -class LimitsToMysql < ActiveRecord::Migration[4.2] - def up - return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/ - - change_column :snippets, :content, :text, limit: 2147483647 - change_column :notes, :st_diff, :text, limit: 2147483647 - end -end diff --git a/db/migrate/markdown_cache_limits_to_mysql.rb b/db/migrate/markdown_cache_limits_to_mysql.rb deleted file mode 100644 index f99d500a137..00000000000 --- a/db/migrate/markdown_cache_limits_to_mysql.rb +++ /dev/null @@ -1,13 +0,0 @@ -class MarkdownCacheLimitsToMysql < ActiveRecord::Migration[4.2] - DOWNTIME = false - - def up - return unless Gitlab::Database.mysql? - - change_column :snippets, :content_html, :text, limit: 2147483647 - end - - def down - # no-op - end -end diff --git a/db/migrate/merge_request_diff_file_limits_to_mysql.rb b/db/migrate/merge_request_diff_file_limits_to_mysql.rb deleted file mode 100644 index 65dd0b5b7f7..00000000000 --- a/db/migrate/merge_request_diff_file_limits_to_mysql.rb +++ /dev/null @@ -1,12 +0,0 @@ -class MergeRequestDiffFileLimitsToMysql < ActiveRecord::Migration[4.2] - DOWNTIME = false - - def up - return unless Gitlab::Database.mysql? - - change_column :merge_request_diff_files, :diff, :text, limit: 2147483647, default: nil - end - - def down - end -end diff --git a/db/migrate/prometheus_metrics_limits_to_mysql.rb b/db/migrate/prometheus_metrics_limits_to_mysql.rb deleted file mode 100644 index f7a2fcba8c2..00000000000 --- a/db/migrate/prometheus_metrics_limits_to_mysql.rb +++ /dev/null @@ -1,12 +0,0 @@ -class PrometheusMetricsLimitsToMysql < ActiveRecord::Migration[4.2] - DOWNTIME = false - - def up - return unless Gitlab::Database.mysql? - - change_column :prometheus_metrics, :query, :text, limit: 4096, default: nil - end - - def down - end -end |