提交 997fd4d0 编写于 作者: R Ryuta Kamizono

Use `add_index` instead of `execute` in guides [ci skip]

上级 685d8a08
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册