debian-mirror-gitlab/db/post_migrate/20210420103955_remove_hipchat_service_records.rb
2021-06-08 01:23:25 +05:30

22 lines
393 B
Ruby

# frozen_string_literal: true
class RemoveHipchatServiceRecords < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
class Service < ActiveRecord::Base
include EachBatch
self.table_name = 'services'
end
def up
Service.each_batch(of: 100_000, column: :id) do |relation|
relation.delete_by(type: 'HipchatService')
end
end
def down
# no-op
end
end