projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
4523: do not include descriptions in search index and update tests accordingly.
[arvados.git]
/
services
/
api
/
db
/
migrate
/
20141208164553_owner_uuid_index.rb
diff --git
a/services/api/db/migrate/20141208164553_owner_uuid_index.rb
b/services/api/db/migrate/20141208164553_owner_uuid_index.rb
index 35358a07364acef02e536a5a87cbf1358d3da72d..e7e38b0716eba4b002f6ac3dcb1bb7db6800dfce 100644
(file)
--- a/
services/api/db/migrate/20141208164553_owner_uuid_index.rb
+++ b/
services/api/db/migrate/20141208164553_owner_uuid_index.rb
@@
-14,7
+14,13
@@
class OwnerUuidIndex < ActiveRecord::Migration
def down
tables_with_owner_uuid.each do |table|
def down
tables_with_owner_uuid.each do |table|
- remove_index table.to_sym, :owner_uuid
+ indexes = ActiveRecord::Base.connection.indexes(table)
+ owner_uuid_index = indexes.select do |index|
+ index.columns == ['owner_uuid']
+ end
+ if !owner_uuid_index.empty?
+ remove_index table.to_sym, :owner_uuid
+ end
end
end
end
end
end
end