Changeset 1588

Show
Ignore:
Timestamp:
05/27/08 15:05:52 (3 months ago)
Author:
mbriggs
Message:

Attempting to prevent queue_url collisions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hive/trunk/data_webapp/app/models/queue_url.rb

    r1575 r1588  
    5555    else 
    5656      obj_hash[:created_at] = Time.now.to_f 
     57      obj_hash[:url_md5] = Digest::MD5.hexdigest(obj_hash[:url]) 
    5758      hist_url = HistoryUrl.find(:first, :order => "time_at DESC", :conditions => {:url => u}) 
    5859      if not hist_url.nil? 
  • hive/trunk/data_webapp/vendor/plugins/mysql_index_prefix/lib/mysql_index_prefix/mysql_index_prefix.rb

    r1565 r1588  
    5454        execute "CREATE #{index_type} INDEX #{quote_column_name(index_name)} ON #{table_name} (#{quoted_column_names})" 
    5555    end 
     56    def remove_index(table_name, column_name, options = {}) 
     57        column_names = column_name.kind_of?(Hash) ? [column_name] : Array(column_name) 
     58        index_name   = index_name(table_name, :column => column_names.first.to_s) 
     59         
     60        if Hash === options # legacy support, since this param was a string 
     61            index_name = options[:name] || index_name 
     62        end 
     63        quoted_column_names = column_names.map { |e| 
     64            if Hash === e 
     65                quote_column_name(e[:name]) + (e[:length] ? "(#{e[:length]})" : "") 
     66            else 
     67                quote_column_name(e) 
     68            end 
     69        }.join(", ") 
     70        execute "DROP INDEX #{quote_column_name(index_name)} ON #{table_name}" 
     71    end 
    5672end 
    5773end