summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 21:06:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 21:06:34 +0000
commite4c711546c693fff89b0b1c92f1b0dde927e0c84 (patch)
tree2afa79ebbb72960fd54f1392e0a18031a1d9ee54 /db
parentb08279013423a66f06f5edde4e067f328fe135bd (diff)
downloadgitlab-ce-e4c711546c693fff89b0b1c92f1b0dde927e0c84.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb46
1 files changed, 0 insertions, 46 deletions
diff --git a/db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb b/db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb
deleted file mode 100644
index b109f582909..00000000000
--- a/db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches < ActiveRecord::Migration[5.2]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- DOWNTIME = false
- BATCH_SIZE = 200
-
- class Project < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'projects'
- self.inheritance_column = :_type_disabled
-
- has_many :protected_branches
- end
-
- class ProtectedBranch < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'protected_branches'
- self.inheritance_column = :_type_disabled
-
- belongs_to :project
- end
-
- def up
- add_concurrent_index :projects, :id, name: "temp_active_projects_with_prot_branches", where: 'archived = false and pending_delete = false and merge_requests_require_code_owner_approval = true'
-
- ProtectedBranch
- .joins(:project)
- .where(projects: { archived: false, pending_delete: false, merge_requests_require_code_owner_approval: true })
- .each_batch(of: BATCH_SIZE) do |batch|
- batch.update_all(code_owner_approval_required: true)
- end
-
- remove_concurrent_index_by_name(:projects, "temp_active_projects_with_prot_branches")
- end
-
- def down
- # noop
- #
- end
-end