aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_postgresql.md
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-06-09 12:58:36 +0200
committerYves Senn <yves.senn@gmail.com>2014-06-09 12:58:36 +0200
commita5c12cbd3c0e9b392edb9e4eb13dcdd256327acd (patch)
tree7aa34ec3152c11ba2cf1ca0a97365636af570589 /guides/source/active_record_postgresql.md
parent97ca81385eeda66925110a5d4d8c288977aac6eb (diff)
downloadrails-a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd.tar.gz
rails-a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd.tar.bz2
rails-a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd.zip
pg guide, add index to PostgreSQL array example. [ci skip]
Diffstat (limited to 'guides/source/active_record_postgresql.md')
-rw-r--r--guides/source/active_record_postgresql.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md
index dfa488773e..fa135b537c 100644
--- a/guides/source/active_record_postgresql.md
+++ b/guides/source/active_record_postgresql.md
@@ -51,11 +51,13 @@ Document.create payload: data
```ruby
# db/migrate/20140207133952_create_books.rb
-create_table :book do |t|
+create_table :books do |t|
t.string 'title'
t.string 'tags', array: true
t.integer 'ratings', array: true
end
+add_index :books, :tags, using: 'gin'
+add_index :books, :ratings, using: 'gin'
# app/models/book.rb
class Book < ActiveRecord::Base