summaryrefslogtreecommitdiff
path: root/db/post_migrate/20221129124240_remove_flowdock_integration_records.rb
blob: 6390ed0d53b453d7edb4702b3de54220890eac3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class RemoveFlowdockIntegrationRecords < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  restrict_gitlab_migration gitlab_schema: :gitlab_main

  class Integration < MigrationRecord
    include EachBatch

    self.table_name = 'integrations'
  end

  def up
    Integration.each_batch(of: 1000, column: :id) do |relation|
      relation.delete_by(type_new: 'Integrations::Flowdock')
    end
  end

  def down
    # no-op
  end
end