{"id":13412075,"url":"https://github.com/plentz/lol_dba","last_synced_at":"2025-04-10T22:29:38.642Z","repository":{"id":2589192,"uuid":"3570815","full_name":"plentz/lol_dba","owner":"plentz","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.","archived":false,"fork":false,"pushed_at":"2024-03-07T18:47:58.000Z","size":397,"stargazers_count":1583,"open_issues_count":17,"forks_count":70,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-03T10:06:29.517Z","etag":null,"topics":["database","database-migrations","gem","migrations","rails","ruby","ruby-on-rails","sql"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plentz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-02-28T12:31:11.000Z","updated_at":"2025-03-28T11:02:13.000Z","dependencies_parsed_at":"2024-06-18T15:26:16.350Z","dependency_job_id":"af43aef6-f4fa-41cc-aaae-6cbe60251fe8","html_url":"https://github.com/plentz/lol_dba","commit_stats":{"total_commits":384,"total_committers":31,"mean_commits":"12.387096774193548","dds":"0.36458333333333337","last_synced_commit":"58e51ae4487fd797b09182e4fb96a2d87a51eab8"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plentz%2Flol_dba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plentz%2Flol_dba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plentz%2Flol_dba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plentz%2Flol_dba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plentz","download_url":"https://codeload.github.com/plentz/lol_dba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248308732,"owners_count":21082069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","database-migrations","gem","migrations","rails","ruby","ruby-on-rails","sql"],"created_at":"2024-07-30T20:01:20.755Z","updated_at":"2025-04-10T22:29:38.619Z","avatar_url":"https://github.com/plentz.png","language":"Ruby","funding_links":[],"categories":["Ruby","Active Record Plugins","ActiveRecord","Database Tools","WebSocket","Awesome Ruby CLIs"],"sub_categories":["Active Record Index Assistants","Database"],"readme":"# lol_dba [![ci](https://github.com/plentz/lol_dba/actions/workflows/build.yml/badge.svg)](https://github.com/plentz/lol_dba/actions) [![Maintainability](https://api.codeclimate.com/v1/badges/a5cc1172ec1291536904/maintainability)](https://codeclimate.com/github/plentz/lol_dba/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/a5cc1172ec1291536904/test_coverage)](https://codeclimate.com/github/plentz/lol_dba/test_coverage)\n\nlol_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.\n\n### Quick example\n\nTo use lol_dba in the easiest way possible you have to do two things:\n\n\tgem install lol_dba\n\nThen run one of the following commands...\n\nTo display a migration for adding/removing all necessary indexes based on associations:\n\n\tlol_dba db:find_indexes\n\nTo generate .sql files for your migrations inside db/migrate_sql folder:\n\n\tlol_dba db:migrate_sql # defaults to all migrations\n\tlol_dba db:migrate_sql[pending] # only pending migrations\n\tlol_dba db:migrate_sql[20120221205526] # generate sql only for migration 20120221205526\n\n### Not-so-quick example\n\nIf you want to use lol_dba with rake, you should do a few more steps:\n\nAdd lol_dba to your Gemfile\n\n    gem \"lol_dba\"\n\nRun the install command\n\n    bundle install\n\nUse it the same way you use other rake commands\n\n\trake db:find_indexes\n\trake db:migrate_sql # defaults to all migrations\n\trake db:migrate_sql[pending] # only pending migrations\n\trake db:migrate_sql[20120221205526] # generate sql only for migration 20120221205526\n\n### Compatibility\n\nCompatible with Ruby 2.x, Ruby 3.x and Rails 3.x, 4.x, 5.x, 6.x, and 7.x.\n\n### About primary_key\n\n\u003eThe primary key is always indexed. This is generally true for all storage engines that at all supports indexes.\n\nFor this reason, we no longer suggest to add indexes to primary keys.\n\n### Tests\n\nTo run lol_dba tests, just clone the repo and run:\n\n    bundle install \u0026\u0026 rake\n\n### Contributors\nMost of the initial code came from [rails_indexes](https://github.com/warpc/rails_indexes) and [migration_sql_generator](https://github.com/muness/migration_sql_generator). [Other people helped as well](https://github.com/plentz/lol_dba/graphs/contributors).\n\n### License\n\nLol DBA is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplentz%2Flol_dba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplentz%2Flol_dba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplentz%2Flol_dba/lists"}