Actions
Bug #12510
open[API] Don't create an index if it exists already. Will break install if we manually added it,
Story points:
-
Release:
Release relationship:
Auto
Description
if the index is already there, we should have some logic to avoid the upgrade of the package to fail. also in postgres we have different ways to doing depending on the version install
https://dba.stackexchange.com/questions/35616/create-index-if-it-does-not-exist
I'm referring to this:
services/api/db/migrate/20171027183824_add_index_to_containers.rb class AddIndexToContainers < ActiveRecord::Migration def up ActiveRecord::Base.connection.execute("CREATE INDEX index_containers_on_modified_at_uuid ON containers USING btree (modified_at desc, uuid asc)") ActiveRecord::Base.connection.execute("CREATE INDEX index_container_requests_on_container_uuid on container_requests (container_uuid)") end def down ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_containers_on_modified_at_uuid") ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS index_container_requests_on_container_uuid") end end
Updated by Tom Morris about 7 years ago
- Subject changed from [API] don't create an index if it's there. will brake install if we manually added it, to [API] Don't create an index if it exists already. Will break install if we manually added it,
- Target version set to Arvados Future Sprints
I'm not sure that having an index with the same name guarantees that it'll match the characteristics of the index in the migration script.
Also, adding special case code to handle manual workarounds smells bad to me.
Updated by Peter Amstutz over 3 years ago
- Target version deleted (
Arvados Future Sprints)
Actions