Sha256: 9597bb637d5cc0ba1d5c24177a43d6652b717a961469ff519dcbd7a96a94b023
Contents?: true
Size: 691 Bytes
Versions: 16
Compression:
Stored size: 691 Bytes
Contents
namespace :fields do desc "Report the current schema" task :report=>:environment do ModalFields.report( :tables=>true, :primary_keys=>true, :foreign_keys=>true, :associations=>true, :undeclared_fields=>true) do |kind, table, name, data| case kind when :table puts "="*50 puts table when :association puts " Foreign keys for #{name} (table: #{data[:foreign_table]})" when :primary_key puts " Primary key: #{name} #{data[:sql_type]}" when :foreign_key puts " #{name} #{data[:sql_type]}" else puts " #{name} #{data[:sql_type]}" end end end end
Version data entries
16 entries across 16 versions & 1 rubygems