Commit b6f24aeb authored by Kerri Miller's avatar Kerri Miller

Merge branch '31343-remove-more-unnecessary-freeze' into 'master'

Remove unnecessary use of freeze .2

See merge request gitlab-org/gitlab!51073
parents 08ece98d f945c6da
---
title: Remove unnecessary use of .freeze
merge_request: 51073
author: Adam Davies @adamd92
type: other
......@@ -8,7 +8,7 @@ class AddIndexToIssuesRelativePosition < ActiveRecord::Migration[5.1]
disable_ddl_transaction!
INDEX_NAME = 'index_issues_on_project_id_and_state_and_rel_position_and_id'.freeze
INDEX_NAME = 'index_issues_on_project_id_and_state_and_rel_position_and_id'
def up
add_concurrent_index :issues, [:project_id, :state, :relative_position, :id], order: { id: :desc }, name: INDEX_NAME
......
......@@ -4,8 +4,8 @@ class AddIndexToEnvironmentsOnProjectIdStateEnvironmentType < ActiveRecord::Migr
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
OLD_INDEX_NAME = 'index_environments_on_project_id_and_state'.freeze
NEW_INDEX_NAME = 'index_environments_on_project_id_state_environment_type'.freeze
OLD_INDEX_NAME = 'index_environments_on_project_id_and_state'
NEW_INDEX_NAME = 'index_environments_on_project_id_state_environment_type'
disable_ddl_transaction!
......
......@@ -4,7 +4,7 @@ class AddProjectIdNameVersionPackageTypeIndexToPackagesPackages < ActiveRecord::
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'idx_packages_packages_on_project_id_name_version_package_type'.freeze
INDEX_NAME = 'idx_packages_packages_on_project_id_name_version_package_type'
disable_ddl_transaction!
......
......@@ -4,7 +4,7 @@ class AddIndexToResourceGroupId < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_for_resource_group'.freeze
INDEX_NAME = 'index_for_resource_group'
disable_ddl_transaction!
......
......@@ -4,7 +4,7 @@ class AddIndexesToDeploymentsOnProjectIdAndRef < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'partial_index_deployments_for_project_id_and_tag'.freeze
INDEX_NAME = 'partial_index_deployments_for_project_id_and_tag'
disable_ddl_transaction!
......
......@@ -4,7 +4,7 @@ class AddGroupIndexAndFkToImportFailures < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
GROUP_INDEX = 'index_import_failures_on_group_id_not_null'.freeze
GROUP_INDEX = 'index_import_failures_on_group_id_not_null'
disable_ddl_transaction!
......
......@@ -5,8 +5,8 @@ class UpdateProjectIndexToImportFailures < ActiveRecord::Migration[5.2]
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
PROJECT_INDEX_OLD = 'index_import_failures_on_project_id'.freeze
PROJECT_INDEX_NEW = 'index_import_failures_on_project_id_not_null'.freeze
PROJECT_INDEX_OLD = 'index_import_failures_on_project_id'
PROJECT_INDEX_NEW = 'index_import_failures_on_project_id_not_null'
disable_ddl_transaction!
......
......@@ -2,8 +2,8 @@
class DropActivatePrometheusServicesBackgroundJobs < ActiveRecord::Migration[6.0]
DOWNTIME = false
DROPPED_JOB_CLASS = 'ActivatePrometheusServicesForSharedClusterApplications'.freeze
QUEUE = 'background_migration'.freeze
DROPPED_JOB_CLASS = 'ActivatePrometheusServicesForSharedClusterApplications'
QUEUE = 'background_migration'
def up
sidekiq_queues.each do |queue|
......
......@@ -7,7 +7,7 @@ class AddIndexToPackageName < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
INDEX_NAME = 'package_name_index'.freeze
INDEX_NAME = 'package_name_index'
def up
add_concurrent_index(:packages_packages, :name, name: INDEX_NAME)
......
......@@ -4,7 +4,7 @@ class AddProjectsIndexOnImportTypeCreatorIdCreatedAt < ActiveRecord::Migration[6
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_imported_projects_on_import_type_creator_id_created_at'.freeze
INDEX_NAME = 'index_imported_projects_on_import_type_creator_id_created_at'
disable_ddl_transaction!
......
......@@ -4,7 +4,7 @@ class RemoveComplianceFrameworksGroupIdFk < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_compliance_management_frameworks_on_group_id_and_name'.freeze
INDEX_NAME = 'index_compliance_management_frameworks_on_group_id_and_name'
class TmpComplianceFramework < ActiveRecord::Base
self.table_name = 'compliance_management_frameworks'
......
......@@ -2,8 +2,8 @@
class DropBackfillJiraTrackerDeploymentTypeJobs < ActiveRecord::Migration[6.0]
DOWNTIME = false
DROPPED_JOB_CLASS = 'BackfillJiraTrackerDeploymentType'.freeze
QUEUE = 'background_migration'.freeze
DROPPED_JOB_CLASS = 'BackfillJiraTrackerDeploymentType'
QUEUE = 'background_migration'
def up
sidekiq_queues.each do |queue|
......
......@@ -3,7 +3,7 @@
class ScheduleMergeRequestAssigneesMigrationProgressCheck < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
MIGRATION = 'MergeRequestAssigneesMigrationProgressCheck'.freeze
MIGRATION = 'MergeRequestAssigneesMigrationProgressCheck'
DOWNTIME = false
......
......@@ -20,8 +20,8 @@ class ScheduleSyncIssuablesStateIdWhereNil < ActiveRecord::Migration[5.1]
#
BATCH_SIZE = 5000
DELAY_INTERVAL = 120.seconds.to_i
ISSUES_MIGRATION = 'SyncIssuesStateId'.freeze
MERGE_REQUESTS_MIGRATION = 'SyncMergeRequestsStateId'.freeze
ISSUES_MIGRATION = 'SyncIssuesStateId'
MERGE_REQUESTS_MIGRATION = 'SyncMergeRequestsStateId'
disable_ddl_transaction!
......
......@@ -7,9 +7,9 @@ class AddIndexToEventsAndAuditEventsCreatedAtAuthorId < ActiveRecord::Migration[
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'analytics_index_%s_on_created_at_and_author_id'.freeze
EVENTS_INDEX_NAME = (INDEX_NAME % 'events').freeze
AUDIT_EVENTS_INDEX_NAME = (INDEX_NAME % 'audit_events').freeze
INDEX_NAME = 'analytics_index_%s_on_created_at_and_author_id'
EVENTS_INDEX_NAME = (INDEX_NAME % 'events')
AUDIT_EVENTS_INDEX_NAME = (INDEX_NAME % 'audit_events')
disable_ddl_transaction!
......
......@@ -2,7 +2,7 @@
class BackfillVersionAuthorAndCreatedAt < ActiveRecord::Migration[5.2]
DOWNTIME = false
MIGRATION = 'BackfillVersionDataFromGitaly'.freeze
MIGRATION = 'BackfillVersionDataFromGitaly'
BATCH_SIZE = 500
disable_ddl_transaction!
......
......@@ -4,7 +4,7 @@ class NullifyUsersRole < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
INDEX_NAME = 'partial_index_users_updated_at_for_cleaning_mistaken_values'.freeze
INDEX_NAME = 'partial_index_users_updated_at_for_cleaning_mistaken_values'
DOWNTIME = false
......
......@@ -5,7 +5,7 @@ class ScheduleFixOrphanPromotedIssues < ActiveRecord::Migration[5.2]
DOWNTIME = false
BATCH_SIZE = 100
BACKGROUND_MIGRATION = 'FixOrphanPromotedIssues'.freeze
BACKGROUND_MIGRATION = 'FixOrphanPromotedIssues'
disable_ddl_transaction!
......
......@@ -6,7 +6,7 @@ class ScheduleMigrateSecurityScans < ActiveRecord::Migration[5.2]
DOWNTIME = false
INTERVAL = 2.minutes.to_i
BATCH_SIZE = 10_000
MIGRATION = 'MigrateSecurityScans'.freeze
MIGRATION = 'MigrateSecurityScans'
disable_ddl_transaction!
......
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