class PactBroker::DB::DataMigrations::SetWebhookUuid

Public Class Methods

call(connection, _options = {}) click to toggle source
# File lib/pact_broker/db/data_migrations/set_webhook_uuid.rb, line 12
def self.call(connection, _options = {})
  if required_columns_exist?(connection)
    connection[:triggered_webhooks].where(uuid: nil).update(uuid: [SecureRandom.uuid, "-", :id].sql_string_join)
  end
end
required_columns_exist?(connection) click to toggle source
# File lib/pact_broker/db/data_migrations/set_webhook_uuid.rb, line 18
def self.required_columns_exist?(connection)
  columns_exist?(connection, :triggered_webhooks, [:uuid])
end