Open Epigene opened 9 months ago
Hi, I'm getting this error when running bundle exec rake db:find_indexes:
bundle exec rake db:find_indexes
NoMethodError: undefined method `sort' for "lower((manufacturing_context)::text)":String (NoMethodError) index.columns.size > 1 ? index.columns.sort : index.columns.first ^^^^^ ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:61:in `block in table_indexes' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:60:in `collect' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:60:in `table_indexes' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:55:in `existing_indexes' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:44:in `block in missing_indexes' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:42:in `each' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:42:in `missing_indexes' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:37:in `check_for_indexes' ruby-3.2.3/gems/lol_dba-2.4.0/lib/lol_dba/index_finding/index_finder.rb:4:in `run' ruby-3.2.3/gems/lol_dba-2.4.0/lib/tasks/lol_dba.rake:6:in `block (2 levels) in <main>' ruby-3.2.3/gems/bugsnag-6.26.0/lib/bugsnag/integrations/rake.rb:20:in `execute' ruby-3.2.3/gems/rake-13.1.0/exe/rake:27:in `<top (required)>' ruby-3.2.3/bin/ruby_executable_hooks:22:in `eval' ruby-3.2.3/bin/ruby_executable_hooks:22:in `<main>'
This likely occurs because a synthetic index is defined:
CREATE INDEX idx_details_lower_manufacturing_context ON public.details USING btree (lower((manufacturing_context)::text));
My env: Ruby 3.2.3 Rails: 7.0 Postgres: 15.5 lol_dba (2.4.0)
Same here: NoMethodError: undefined method `sort' for "lower((code)::text), locked_at":String
Happens when you have a complex index
Hi, I'm getting this error when running
bundle exec rake db:find_indexes
:This likely occurs because a synthetic index is defined:
My env: Ruby 3.2.3 Rails: 7.0 Postgres: 15.5 lol_dba (2.4.0)