Permalink
Browse files

Revert "remove some existing indexes and use the unique index instead"

This reverts commit e4ef265.
  • Loading branch information...
1 parent e4ef265 commit f542b7e5610b3e1480e0ec5f75d63e2e5c404d4b @qrush qrush committed Mar 18, 2011
Showing with 4 additions and 6 deletions.
  1. +2 −6 db/migrate/20110318162103_add_unique_indexes.rb
  2. +2 −0 db/schema.rb
@@ -1,17 +1,13 @@
class AddUniqueIndexes < ActiveRecord::Migration
def self.up
- remove_index :versions, :rubygem_id
- remove_index :versions, :number
- remove_index :rubygems, :name
+ remove_index :rubygems, :column => [:name]
add_index :rubygems, [:name], :unique => true
add_index :versions, [:rubygem_id, :number, :platform], :unique => true
end
def self.down
remove_index :versions, :column => [:rubygem_id, :number, :platform]
remove_index :rubygems, :column => [:name]
- add_index :rubygems, :name
- add_index :versions, :number
- add_index :versions, :rubygem_id
+ add_index :rubygems, [:name]
end
end
View
@@ -148,9 +148,11 @@
add_index "versions", ["created_at"], :name => "index_versions_on_created_at"
add_index "versions", ["full_name"], :name => "index_versions_on_full_name"
add_index "versions", ["indexed"], :name => "index_versions_on_indexed"
+ add_index "versions", ["number"], :name => "index_versions_on_number"
add_index "versions", ["position"], :name => "index_versions_on_position"
add_index "versions", ["prerelease"], :name => "index_versions_on_prerelease"
add_index "versions", ["rubygem_id", "number", "platform"], :name => "index_versions_on_rubygem_id_and_number_and_platform", :unique => true
+ add_index "versions", ["rubygem_id"], :name => "index_versions_on_rubygem_id"
create_table "web_hooks", :force => true do |t|
t.integer "user_id"

0 comments on commit f542b7e

Please sign in to comment.