[ARVADOS] updated: 9bec80bcc55f2985f694b8172e755e94e11f59ae

git at public.curoverse.com git at public.curoverse.com
Thu Dec 11 22:44:03 EST 2014


Summary of changes:
 services/api/db/migrate/20141208185217_search_index.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

       via  9bec80bcc55f2985f694b8172e755e94e11f59ae (commit)
      from  f7e3001b53e9f26fd1d413308093bb9700bb9287 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9bec80bcc55f2985f694b8172e755e94e11f59ae
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Thu Dec 11 22:43:10 2014 -0500

    4523: update down method in search migration script to drop index only when it exists.

diff --git a/services/api/db/migrate/20141208185217_search_index.rb b/services/api/db/migrate/20141208185217_search_index.rb
index dc50fd1..639bdc2 100644
--- a/services/api/db/migrate/20141208185217_search_index.rb
+++ b/services/api/db/migrate/20141208185217_search_index.rb
@@ -32,7 +32,13 @@ class SearchIndex < ActiveRecord::Migration
 
   def down
     tables_with_searchable_columns.each do |table, columns|
-      remove_index(table.to_sym, name: "#{table}_search_index")
+      indexes = ActiveRecord::Base.connection.indexes(table)
+      search_index = indexes.select do |index|
+        index.name == "#{table}_search_index"
+      end
+      if !search_index.empty?
+        remove_index(table.to_sym, name: "#{table}_search_index")
+      end
     end
   end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list