From 997fd4d024474b3858f073db6c0da0604d9b2f81 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sat, 28 May 2016 14:26:04 +0900 Subject: Use `add_index` instead of `execute` in guides [ci skip] --- guides/source/active_record_postgresql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/active_record_postgresql.md') diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md index 5eb19f5214..dee64e6439 100644 --- a/guides/source/active_record_postgresql.md +++ b/guides/source/active_record_postgresql.md @@ -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 -- cgit v1.2.3