Commit 0a5b670a authored by Douwe Maan's avatar Douwe Maan
Browse files

Exclude migrations from Style/MutableConstant

parent d4b1f62b6acd
......@@ -354,6 +354,9 @@ Style/MultilineTernaryOperator:
# mutable literal (e.g. array or hash).
Style/MutableConstant:
Enabled: true
Exclude:
- 'db/migrate/**/*'
- 'db/post_migrate/**/*'
# Favor unless over if for negative conditions (or control flow or).
Style/NegatedIf:
......
......@@ -3,7 +3,7 @@
class MoveFromDevelopersCanMergeToProtectedBranchesMergeAccess < ActiveRecord::Migration
DOWNTIME = true
DOWNTIME_REASON = <<-HEREDOC.freeze
DOWNTIME_REASON = <<-HEREDOC
We're creating a `merge_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
is running, we might be left with a `protected_branch` _without_ an associated `merge_access_level`. The `protected_branches`
table must not change while this is running, so downtime is required.
......
......@@ -3,7 +3,7 @@
class MoveFromDevelopersCanPushToProtectedBranchesPushAccess < ActiveRecord::Migration
DOWNTIME = true
DOWNTIME_REASON = <<-HEREDOC.freeze
DOWNTIME_REASON = <<-HEREDOC
We're creating a `push_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
is running, we might be left with a `protected_branch` _without_ an associated `push_access_level`. The `protected_branches`
table must not change while this is running, so downtime is required.
......
......@@ -10,7 +10,7 @@ class RemoveProjectIdFromSpamLogs < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
DOWNTIME_REASON = 'Removing a column that contains data that is not used anywhere.'.freeze
DOWNTIME_REASON = 'Removing a column that contains data that is not used anywhere.'
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
......
......@@ -2,7 +2,7 @@ class ChangeMergeErrorToText < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'This migration requires downtime because it alters a column from varchar(255) to text.'.freeze
DOWNTIME_REASON = 'This migration requires downtime because it alters a column from varchar(255) to text.'
def change
change_column :merge_requests, :merge_error, :text, limit: 65535
......
......@@ -10,7 +10,7 @@ class AddTableIssueMetrics < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
DOWNTIME_REASON = 'Adding foreign key'.freeze
DOWNTIME_REASON = 'Adding foreign key'
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
......
......@@ -10,7 +10,7 @@ class AddTableMergeRequestMetrics < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
DOWNTIME_REASON = 'Adding foreign key'.freeze
DOWNTIME_REASON = 'Adding foreign key'
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
......
......@@ -7,7 +7,7 @@ class RemoveFeaturesEnabledFromProjects < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
DOWNTIME = true
DOWNTIME_REASON = "Removing fields from database requires downtine.".freeze
DOWNTIME_REASON = "Removing fields from database requires downtine."
def up
remove_column :projects, :issues_enabled
......
......@@ -5,7 +5,7 @@ class RemoveProjectsPushesSinceGc < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'This migration removes an existing column'.freeze
DOWNTIME_REASON = 'This migration removes an existing column'
disable_ddl_transaction!
......
......@@ -3,7 +3,7 @@ class ChangeArtifactsSizeColumn < ActiveRecord::Migration
DOWNTIME = true
DOWNTIME_REASON = 'Changing an integer column size requires a full table rewrite.'.freeze
DOWNTIME_REASON = 'Changing an integer column size requires a full table rewrite.'
def up
change_column :ci_builds, :artifacts_size, :integer, limit: 8
......
......@@ -10,7 +10,7 @@ class CreateMergeRequestsClosingIssues < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
DOWNTIME_REASON = 'Adding foreign keys'.freeze
DOWNTIME_REASON = 'Adding foreign keys'
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
......
......@@ -2,7 +2,7 @@ class AddTypeToLabels < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Labels will not work as expected until this migration is complete.'.freeze
DOWNTIME_REASON = 'Labels will not work as expected until this migration is complete.'
def change
add_column :labels, :type, :string
......
......@@ -2,7 +2,7 @@ class CreateLabelPriorities < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'This migration adds foreign keys'.freeze
DOWNTIME_REASON = 'This migration adds foreign keys'
disable_ddl_transaction!
......
......@@ -2,7 +2,7 @@ class AddUniqueIndexToLabels < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'This migration removes duplicated labels.'.freeze
DOWNTIME_REASON = 'This migration removes duplicated labels.'
disable_ddl_transaction!
......
......@@ -2,7 +2,7 @@ class MigrateLabelsPriority < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Prioritized labels will not work as expected until this migration is complete.'.freeze
DOWNTIME_REASON = 'Prioritized labels will not work as expected until this migration is complete.'
disable_ddl_transaction!
......
......@@ -2,7 +2,7 @@ class RemovePriorityFromLabels < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'This migration removes an existing column'.freeze
DOWNTIME_REASON = 'This migration removes an existing column'
disable_ddl_transaction!
......
......@@ -8,7 +8,7 @@ class MigrateSidekiqQueuesFromDefault < ActiveRecord::Migration
DOWNTIME = true
DOWNTIME_REASON = <<-EOF.freeze
DOWNTIME_REASON = <<-EOF
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Sidekiq will result in the loss of jobs that are scheduled after this
migration completes.
......
class GenerateProjectFeatureForProjects < ActiveRecord::Migration
DOWNTIME = true
DOWNTIME_REASON = <<-HEREDOC.freeze
DOWNTIME_REASON = <<-HEREDOC
Application was eager loading project_feature for all projects generating an extra query
everytime a project was fetched. We removed that behavior to avoid the extra query, this migration
makes sure all projects have a project_feature record associated.
......
......@@ -12,7 +12,7 @@ class AddPipelineIdToMergeRequestMetrics < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
DOWNTIME_REASON = 'Adding a foreign key'.freeze
DOWNTIME_REASON = 'Adding a foreign key'
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
......
......@@ -8,7 +8,7 @@ class MigrateMailroomQueueFromDefault < ActiveRecord::Migration
DOWNTIME = true
DOWNTIME_REASON = <<-EOF.freeze
DOWNTIME_REASON = <<-EOF
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Sidekiq will result in the loss of jobs that are scheduled after this
migration completes.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment