Module: Foreigner::SchemaDumper::InstanceMethods

Defined in:
lib/foreigner/schema_dumper.rb

Instance Method Summary collapse

Instance Method Details

#tables_with_foreign_keys(stream) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/foreigner/schema_dumper.rb', line 11

def tables_with_foreign_keys(stream)
  tables_without_foreign_keys(stream)
  @connection.tables.sort.each do |table|
    next unless foreign_keys = @connection.foreign_keys(table)
    stream.puts generate_foreign_keys_statements(foreign_keys).join("\n")
  end
end