module PactBroker::DB::DataMigrations::Helpers

Public Instance Methods

column_exists?(connection, table, column) click to toggle source
# File lib/pact_broker/db/data_migrations/helpers.rb, line 5
def column_exists?(connection, table, column)
  connection.table_exists?(table) && connection.schema(table).find{|col| col.first == column }
end
columns_exist?(connection, table, columns) click to toggle source
# File lib/pact_broker/db/data_migrations/helpers.rb, line 9
def columns_exist?(connection, table, columns)
  columns.all?{ | column | column_exists?(connection, table, column) }
end