11908: Fix crash if index being deleted is already deleted.
authorTom Clegg <tom@curoverse.com>
Tue, 11 Jul 2017 14:25:16 +0000 (10:25 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 7 Dec 2017 15:24:37 +0000 (10:24 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curoverse.com>

services/api/db/migrate/20170706141334_json_collection_properties.rb

index 35ee7eaf3ac2c977856dcf7a6146f03458550aa5..55ab0df4dda72ee32d43f5ffec6f1c41e1a327b9 100644 (file)
@@ -2,7 +2,7 @@ require './db/migrate/20161213172944_full_text_search_indexes'
 
 class JsonCollectionProperties < ActiveRecord::Migration
   def up
-    ActiveRecord::Base.connection.execute 'DROP INDEX collections_full_text_search_idx'
+    ActiveRecord::Base.connection.execute 'DROP INDEX IF EXISTS collections_full_text_search_idx'
     ActiveRecord::Base.connection.execute 'ALTER TABLE collections ALTER COLUMN properties TYPE jsonb USING properties::jsonb'
     FullTextSearchIndexes.new.replace_index('collections')
   end