Concurrent index migrations for Rails
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.gitignore
CHANGELOG.md
Gemfile
README.md
Rakefile
gindex.gemspec

README.md

g index

🚤 Instant concurrent index migrations for Rails

rails g index users email

generates:

class AddIndexOnEmailToUsers < ActiveRecord::Migration[5.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

Installation

Add this line to your application’s Gemfile:

gem 'gindex', group: :development

And then execute:

bundle

TODO

  • add :name option to long index names

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help: