Skip to content

How to add WHERE discarded_at IS NULL #117

Answered by erick-ol
erick-ol asked this question in Q&A
Discussion options

You must be logged in to vote

I already discover it by creating a migration using the example below:

def change
  remove_index :jobs, name: :index_jobs_on_area_id
  add_index :jobs, :area_id, where: 'discarded_at IS NULL'
end

To update an index you need to remove it first and then create in the right way after

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by erick-ol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant