activerecord-cockroachdb-adapter icon indicating copy to clipboard operation
activerecord-cockroachdb-adapter copied to clipboard

Remove index

Open Piioo opened this issue 2 years ago • 1 comments

Hello,

it is not possible to remove an index with rails commands, when there are two indexes in different tables with the same name.

remove_index :foo, name: :bar_index

Then the name of the tables is set is unimportant.

-- remove_index(:foo, {:name=>:bar_index})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

PG::AmbiguousParameter: ERROR:  index name "bar_index" is ambiguous (found in db_dev.public.foo and db_dev.public.baz)

Piioo avatar Jan 20 '23 08:01 Piioo

Hi @Piioo,

Sorry your issue was unanswered for so long. Did you end up solving it ? It feels like this should be a normal behaviour if the schemas are all accessible to the adapter (you can check this with #schema_names)

BuonOmo avatar Sep 03 '24 15:09 BuonOmo