Module: Foreigner::SchemaDumper::InstanceMethods

Defined in:
lib/foreigner/schema_dumper.rb

Instance Method Summary collapse

Instance Method Details

#tables_with_foreign_keys(stream) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/foreigner/schema_dumper.rb', line 12

def tables_with_foreign_keys(stream)
  if ActiveRecord::ConnectionAdapters.const_defined?(:SQLServerAdapter)
    @connection.tables.sort.each do |table|
      remove_foreign_keys(table, stream)
    end
  end
  tables_without_foreign_keys(stream)
  @connection.tables.sort.each do |table|
    primary_keys(table, stream)
  end
  @connection.tables.sort.each do |table|
    foreign_keys(table, stream)
  end
end