Sha256: de481143da940d6741178d56a13b2145f1278c6276c2906d3172b62d94f4b262
Contents?: true
Size: 1.03 KB
Versions: 73
Compression:
Stored size: 1.03 KB
Contents
module ActiveRecord module ConnectionAdapters class PostgreSQLAdapter < AbstractAdapter module ReferentialIntegrity def supports_disable_referential_integrity? #:nodoc: true end def disable_referential_integrity #:nodoc: if supports_disable_referential_integrity? begin execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER ALL" }.join(";")) rescue execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER USER" }.join(";")) end end yield ensure if supports_disable_referential_integrity? begin execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER ALL" }.join(";")) rescue execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER USER" }.join(";")) end end end end end end end
Version data entries
73 entries across 73 versions & 3 rubygems