Skip to content

Commit

Permalink
Merge pull request #25176 from kamipo/use_add_index_in_guides
Browse files Browse the repository at this point in the history
Use `add_index` instead of `execute` in guides [ci skip]
  • Loading branch information
vipulnsward committed May 28, 2016
2 parents 685d8a0 + 997fd4d commit 3ce3b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guides/source/active_record_postgresql.md
Expand Up @@ -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
Expand Down

0 comments on commit 3ce3b22

Please sign in to comment.