Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid index recommendation for Doorkeeper Gem #105

Open
ericraio opened this issue Apr 22, 2019 · 4 comments
Open

Invalid index recommendation for Doorkeeper Gem #105

ericraio opened this issue Apr 22, 2019 · 4 comments

Comments

@ericraio
Copy link

I am getting this recommendation after installing the door keeper gem.

  1) DB Indexes sets the proper db indexes
     Failure/Error:
       expect(`rake db:find_indexes`).to match(/Yey, no missing indexes found!/), lambda {
                               "Missing db indexes were find run `rake db:find_indexes'" }

       Missing db indexes were find run `rake db:find_indexes'
       Diff:
       @@ -1,2 +1,11 @@
       -/Yey, no missing indexes found!/
       +* TIP: if you have a problem with the index name('index name too long'), you can
       +solve with the :name option. Something like :name => 'my_index'.
       +* run `rails g migration AddMissingIndexes` and add the following content:
       +
       +    class AddMissingIndexes < ActiveRecord::Migration
       +      def change
       +        add_index :oauth_access_tokens, [:doorkeeper/application_id, :doorkeeper/application_id]
       +      end
       +    end

Any idea how I can resolve this?

@plentz
Copy link
Owner

plentz commented Apr 25, 2019

@ericraio are you trying to run lol_dba tests with a new gem?

@ericraio
Copy link
Author

@ericraio are you trying to run lol_dba tests with a new gem?

No tests or anything like that, I just have a simple test that executes lol_dba

When running rake db:find_indexes, it's saying that I need to put an index for doorkeeper's table.

To reproduce,

add the gem lol_dba
and doorkeeper + create doorkeeper tables

@ericraio
Copy link
Author

ericraio commented May 17, 2019

@plentz

I'd like to highlight that lol_dba is failing because

the model class is Doorkeeper::Application and when you convert a nested model like this to underscore, it generates doorkeeper/application instead of doorkeeper_application

In addition to above,

add_index :oauth_access_tokens, [:doorkeeper/application_id, :doorkeeper/application_id]

This would not be the proper table because it is redefined internally.

@sobrinho
Copy link
Contributor

I'm working on that on #81.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants