Skip to content

Instantly share code, notes, and snippets.

@canweriotnow
Created April 8, 2014 15:50
Show Gist options
  • Save canweriotnow/10146439 to your computer and use it in GitHub Desktop.
Save canweriotnow/10146439 to your computer and use it in GitHub Desktop.
CreatePosts
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.string :title
t.text :body
t.integer :tag_array, array: true. default: []
t.timestamps
end
add_index :posts, :tag_array, using: 'gin'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment