{"repo":"plentz/lol_dba","free":true,"listed":false,"github":"https://github.com/plentz/lol_dba","clone":"git clone https://github.com/plentz/lol_dba.git","description":"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.","language":"Ruby","stars":1594,"topics":["rails","database","migrations","sql","ruby","ruby-on-rails","gem","database-migrations"],"license":null,"category":"databases-storage","readme_excerpt":"lol dba 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. Quick example To use lol dba in the easiest way possible you have to do two things: gem install lol dba Then run one of the following commands... To display a migration for adding/removing all necessary indexes based on associations: lol dba db:find indexes To generate .sql files for your migrations inside db/migrate sql folder: lol dba db:migrate sql # defaults to all migrations lol dba db:migrate sql[pending] # only pending migrations lol dba db:migrate sql[20120221205526] # generate sql only for migration 20120221205526 Not-so-quick example If you want to use lol dba with rake, you should do a few more steps: Add lol dba to your Gemfile gem \"lol dba\" Run the install command bundle install Use it the same way you use other rake commands rake db:find indexes rake db:migrate sql # defaults to all migrations rake db:migrate sql[pending] # only pending migrations rake db:migrate sql[20120221205526] # generate sql only for migration 20120221205526 Compatibility Compatible with Ruby 2.x, Ruby 3.x and Rails 3.x, 4.x, 5.x, 6.x, 7.x and 8.x. About primary key The primary key is always indexed. This is generally true for all storage engines that at all supports indexes. For this reason, we no longer suggest to add indexes to primary keys. Tests To run lol dba tests, just clone the repo and run:","default_branch":null,"files":null,"tree":[],"storefront":"/r/plentz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/plentz/lol_dba/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}