1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use add_index instead of execute in guides [ci skip]

This commit is contained in:
Ryuta Kamizono 2016-05-28 14:26:04 +09:00
parent 685d8a088f
commit 997fd4d024

View file

@ -435,7 +435,7 @@ create_table :documents do |t|
t.string 'body'
end
execute "CREATE INDEX documents_idx ON documents USING gin(to_tsvector('english', title || ' ' || body));"
add_index :documents, "to_tsvector('english', title || ' ' || body)", using: :gin, name: 'documents_idx'
# app/models/document.rb
class Document < ApplicationRecord