class DatabaseFlusher::ActiveRecord::PostgreSQLAdapter

Private Instance Methods

disable_referential_integrity(*tables) { || ... } click to toggle source
# File lib/database_flusher/active_record/adapters/postgresql_adapter.rb, line 7
def disable_referential_integrity(*tables)
  execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER ALL" }.join(";"))
  yield
ensure
  execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER ALL" }.join(";"))
end