debian-mirror-gitlab/db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb
2022-04-04 11:22:00 +05:30

20 lines
512 B
Ruby

# frozen_string_literal: true
class PopulateAuditEventStreamingVerificationToken < Gitlab::Database::Migration[1.0]
class ExternalAuditEventDestination < ActiveRecord::Base
self.table_name = 'audit_events_external_audit_event_destinations'
def regenerate_verification_token
update!(verification_token: SecureRandom.base58(24))
end
end
def up
ExternalAuditEventDestination.all.each { |destination| destination.regenerate_verification_token }
end
def down
# no-op
end
end