lib/eol/db.rb
# truncates all tables in all databases
truncates all tables in all databases
truncates all tables in all databases
def truncate_all_tables(options = {})
        options[:verbose] ||= false
        EOL::Db.all_connections.uniq.each do |conn|
          count = 0
          conn.tables.each do |table|
            next if table == 'schema_migrations'
            count += 1
            if conn.respond_to? :with_master
              conn.with_master do
                truncate_table(conn, table)
              end
            else
              truncate_table(conn, table)
            end
          end
          if options[:verbose]
            puts "-- Truncated #{count} tables in " +
              conn.instance_eval { @config[:database] } +
              "."
          end
        end
      end
def truncate_all_tables ( options = { } ) options [ :verbose ] ||= false EOL :: Db . all_connections . uniq . each do | conn | count = 0 conn . tables . each do | table | next if table == 'schema_migrations' count += 1 if conn . respond_to? :with_master conn . with_master do truncate_table ( conn , table ) end else truncate_table ( conn , table ) end end if options [ :verbose ] puts "-- Truncated #{count} tables in " + conn . instance_eval { @config [ :database ] } + "." end end end
truncates all tables in all databases
truncates all tables in all databases
# EOL.forget_everything # expensive, but without it, would risk errors.
options
<not_specific>