lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.
After migrating some indexes that were reported missing by this gem, I ran it again, and while I was expecting this:
Yey, no missing indexes found!
I got this output instead:
* 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
end
end
This is because this line that checks for empty indexes/keys isn't actually empty at that point. It's only later that those indexes in question are skipped here.
After migrating some indexes that were reported missing by this gem, I ran it again, and while I was expecting this:
I got this output instead:
This is because this line that checks for empty indexes/keys isn't actually empty at that point. It's only later that those indexes in question are skipped here.
I will open a PR to fix this problem.