plentz/lol_dba
plentz/lol_dba has 1,595 GitHub stars and 71 forks. GitHot measured 0 stars in 24 hours, -1 in 7 days, and -1 in 15 days. Last checked 2026-11-21 09:27 UTC. Last push 2026-03-23.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
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.
데이터README.md
Originallol_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:
bundle install && rake
Contributors
Most of the initial code came from rails_indexes and migration_sql_generator. Other people helped as well.
License
Lol DBA is released under the MIT license.
관련 프로젝트 살펴보기
불러오는 중…