diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-06-09 12:58:36 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-06-09 12:58:36 +0200 |
commit | a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd (patch) | |
tree | 7aa34ec3152c11ba2cf1ca0a97365636af570589 /guides | |
parent | 97ca81385eeda66925110a5d4d8c288977aac6eb (diff) | |
download | rails-a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd.tar.gz rails-a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd.tar.bz2 rails-a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd.zip |
pg guide, add index to PostgreSQL array example. [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_record_postgresql.md | 4 |
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 |