Class: PactBroker::DB::DataMigrations::DeleteDeprecatedWebhookExecutions

Inherits:
Object
  • Object
show all
Extended by:
Helpers
Defined in:
lib/pact_broker/db/data_migrations/delete_deprecated_webhook_executions.rb

Class Method Summary collapse

Methods included from Helpers

column_exists?, columns_exist?

Class Method Details

.call(connection) ⇒ Object



9
10
11
12
13
# File 'lib/pact_broker/db/data_migrations/delete_deprecated_webhook_executions.rb', line 9

def self.call(connection)
  if columns_exist?(connection)
    connection[:webhook_executions].where(triggered_webhook_id: nil).delete
  end
end

.columns_exist?(connection) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/pact_broker/db/data_migrations/delete_deprecated_webhook_executions.rb', line 15

def self.columns_exist?(connection)
  column_exists?(connection, :webhook_executions, :triggered_webhook_id)
end