Awesome
g index
:speedboat: Instant concurrent index migrations for Rails
Installation
Add this line to your application’s Gemfile:
gem "gindex", group: :development
How It Works
rails g index users email
generates:
class AddIndexOnEmailToUsers < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :users, :email, algorithm: :concurrently
end
end
Also works with multi-column indexes
rails g index deliveries store_id delivered_at
TODO
- add
:name
option to long index names
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/gindex.git
cd gindex
bundle install