Commit 8f01b42b authored by Arturo Herrero's avatar Arturo Herrero

Remove again GitlabIssueTrackerService records

This is the last commit of the plan to remove the
GitlabIssueTrackerService, see:
https://gitlab.com/gitlab-org/gitlab/-/issues/218526#note_380963641

1. Remove the records in a post-migration
   https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35221
2. Remove the GitLabIssueTrackerService class
   https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36063
3. Run the migration again to remove any existing records in a
   post-migration. This commit!
parent 6b5247fd
---
title: Remove GitlabIssueTrackerService database records
merge_request: 37931
author:
type: other
# frozen_string_literal: true
class RemoveAgainGitlabIssueTrackerServiceRecords < ActiveRecord::Migration[6.0]
DOWNTIME = false
BATCH_SIZE = 5000
disable_ddl_transaction!
class Service < ActiveRecord::Base
include EachBatch
self.table_name = 'services'
def self.gitlab_issue_tracker_service
where(type: 'GitlabIssueTrackerService')
end
end
def up
Service.each_batch(of: BATCH_SIZE) do |services|
services.gitlab_issue_tracker_service.delete_all
end
end
def down
# no-op
end
end
83c1dca01d4e56c22f6c1cda249c9b162eb7c31e2b164629bf51ea9aa9dd8fb5
\ No newline at end of file
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