patch

remove index with confirmation - Akiko Takano, 2013-01-05 20:07

Download (749 Bytes)

 
1
Index: db/migrate/091_change_changesets_revision_to_string.rb
2
===================================================================
3
--- db/migrate/091_change_changesets_revision_to_string.rb	(revision 11125)
4
+++ db/migrate/091_change_changesets_revision_to_string.rb	(working copy)
5
@@ -1,6 +1,8 @@
6
 class ChangeChangesetsRevisionToString < ActiveRecord::Migration
7
   def self.up
8
-    remove_index  :changesets, :name => :changesets_repos_rev
9
+    if index_exists? :chengesets, :changesets_repos_rev
10
+    	remove_index  :changesets, :name => :changesets_repos_rev
11
+    end
12
     change_column :changesets, :revision, :string, :null => false
13
     add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev
14
   end