Skip to content

Instantly share code, notes, and snippets.

@tom-lord
Created October 12, 2018 15:02
Show Gist options
  • Save tom-lord/811822de108fb97201a4a03e1b17bf96 to your computer and use it in GitHub Desktop.
Save tom-lord/811822de108fb97201a4a03e1b17bf96 to your computer and use it in GitHub Desktop.
class AddOrderedDealershipIdExpiredAtIndexToLeaseDeals < ActiveRecord::Migration[5.2]
def change
remove_index :lease_deals, name: :index_lease_deals_on_dealership_id_and_expired_at, algorithm: :concurrently
add_index :lease_deals, %i[id dealership_id expired_at], where: 'expired_at IS NULL', using: :btree, order: { id: :asc }, algorithm: :concurrently
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment