mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #25176 from kamipo/use_add_index_in_guides
Use `add_index` instead of `execute` in guides [ci skip]
This commit is contained in:
commit
3ce3b2233a
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue