Commit d3ac3c94 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix Rubocop offenses for EE migrations

parent 43971ef2
# rubocop:disable Migration/Timestamps
# rubocop:disable Migration/Datetime
class CreateUserActivities < ActiveRecord::Migration class CreateUserActivities < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime. # Set this constant to true if this migration requires downtime.
DOWNTIME = true DOWNTIME = true
......
# See http://doc.gitlab.com/ce/development/migration_style_guide.html # See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab. # for more information on how to write migrations for GitLab.
# rubocop:disable Migration/Datetime
class DropUserActivitiesTable < ActiveRecord::Migration class DropUserActivitiesTable < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
......
# rubocop:disable Rails/ReversibleMigration
class UpdateGroupLinks < ActiveRecord::Migration class UpdateGroupLinks < ActiveRecord::Migration
def change def change
provider = quote_string(Gitlab::Auth::LDAP::Config.providers.first) provider = quote_string(Gitlab::Auth::LDAP::Config.providers.first)
......
...@@ -19,6 +19,7 @@ class CanonicalizeKerberosIdentities < ActiveRecord::Migration ...@@ -19,6 +19,7 @@ class CanonicalizeKerberosIdentities < ActiveRecord::Migration
def change def change
reversible do |dir| reversible do |dir|
# rubocop:disable Cop/AvoidReturnFromBlocks
return unless kerberos_default_realm.present? return unless kerberos_default_realm.present?
dir.up do dir.up do
......
# rubocop:disable Migration/Timestamps # rubocop:disable Migration/Timestamps
# rubocop:disable Migration/Datetime
class CreateIndexStatuses < ActiveRecord::Migration class CreateIndexStatuses < ActiveRecord::Migration
def change def change
create_table :index_statuses do |t| create_table :index_statuses do |t|
......
# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps # rubocop:disable Migration/Timestamps
class CreateRemoteMirrorsEE < ActiveRecord::Migration class CreateRemoteMirrorsEE < ActiveRecord::Migration
def up def up
......
# Migration type: online without errors (works on previous version and new one) # Migration type: online without errors (works on previous version and new one)
# rubocop:disable Migration/AddColumnWithDefaultToLargeTable
# rubocop:disable Migration/Datetime # rubocop:disable Migration/Datetime
# rubocop:disable Migration/UpdateLargeTable # rubocop:disable Migration/UpdateLargeTable
class AddLdapSyncStateToGroups < ActiveRecord::Migration class AddLdapSyncStateToGroups < ActiveRecord::Migration
......
# rubocop:disable Migration/AddColumnWithDefaultToLargeTable
# rubocop:disable Migration/UpdateLargeTable # rubocop:disable Migration/UpdateLargeTable
class AddSquashToMergeRequestsEE < ActiveRecord::Migration class AddSquashToMergeRequestsEE < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
......
# See http://doc.gitlab.com/ce/development/migration_style_guide.html # See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab. # for more information on how to write migrations for GitLab.
# rubocop:disable Migration/AddColumnWithDefaultToLargeTable
# rubocop:disable Migration/UpdateLargeTable # rubocop:disable Migration/UpdateLargeTable
class AddColumnAuditorToUsers < ActiveRecord::Migration class AddColumnAuditorToUsers < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
......
# rubocop:disable Migration/AddColumnWithDefaultToLargeTable
# rubocop:disable Migration/UpdateLargeTable # rubocop:disable Migration/UpdateLargeTable
class AddSyncScheduleToProjectsAndRemoteProjects < ActiveRecord::Migration class AddSyncScheduleToProjectsAndRemoteProjects < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
......
# rubocop:disable Migration/Datetime
class CreateGeoRepositoryUpdatedEvents < ActiveRecord::Migration class CreateGeoRepositoryUpdatedEvents < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
......
# rubocop:disable Migration/Datetime
class CreateGeoEventLog < ActiveRecord::Migration class CreateGeoEventLog < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
......
class CreateProjectRepositoryStates < ActiveRecord::Migration class CreateProjectRepositoryStates < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def change def change
......
...@@ -18,6 +18,7 @@ class CreateChatopsTables < ActiveRecord::Migration ...@@ -18,6 +18,7 @@ class CreateChatopsTables < ActiveRecord::Migration
t.index :pipeline_id, unique: true t.index :pipeline_id, unique: true
end end
# rubocop:disable Migration/AddConcurrentForeignKey
add_foreign_key :ci_pipeline_chat_data, :ci_pipelines, add_foreign_key :ci_pipeline_chat_data, :ci_pipelines,
column: :pipeline_id, column: :pipeline_id,
on_delete: :cascade on_delete: :cascade
......
class AddExternalAuthMutualTlsFieldsToProjectSettings < ActiveRecord::Migration class AddExternalAuthMutualTlsFieldsToProjectSettings < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def change def change
......
...@@ -11,4 +11,3 @@ class AddNegativeMatchingCommitMessagePushRule < ActiveRecord::Migration ...@@ -11,4 +11,3 @@ class AddNegativeMatchingCommitMessagePushRule < ActiveRecord::Migration
remove_column :push_rules, :commit_message_negative_regex remove_column :push_rules, :commit_message_negative_regex
end end
end end
...@@ -10,6 +10,7 @@ class AddIndexesToProjectMirrorDataEE < ActiveRecord::Migration ...@@ -10,6 +10,7 @@ class AddIndexesToProjectMirrorDataEE < ActiveRecord::Migration
end end
def down def down
# rubocop:disable Migration/RemoveIndex
remove_index :project_mirror_data, :last_successful_update_at if index_exists? :project_mirror_data, :last_successful_update_at remove_index :project_mirror_data, :last_successful_update_at if index_exists? :project_mirror_data, :last_successful_update_at
end end
end end
...@@ -4,6 +4,7 @@ class AddGeoNodesVerificationMaxCapacity < ActiveRecord::Migration ...@@ -4,6 +4,7 @@ class AddGeoNodesVerificationMaxCapacity < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def change def change
# rubocop:disable Migration/AddColumn
add_column :geo_nodes, :verification_max_capacity, :integer, default: 100, null: false add_column :geo_nodes, :verification_max_capacity, :integer, default: 100, null: false
end end
end end
...@@ -29,6 +29,7 @@ class DropRepositoryStorageEventsForGeoEvents < ActiveRecord::Migration ...@@ -29,6 +29,7 @@ class DropRepositoryStorageEventsForGeoEvents < ActiveRecord::Migration
private private
def update_repository_storage_path(table) def update_repository_storage_path(table)
# rubocop:disable Migration/UpdateColumnInBatches
update_column_in_batches(table, :repository_storage_path, update_statement) do |t, q| update_column_in_batches(table, :repository_storage_path, update_statement) do |t, q|
q.where(t[:repository_storage_path].eq(nil)) q.where(t[:repository_storage_path].eq(nil))
end end
......
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