Skip to content

Instantly share code, notes, and snippets.

@h0lyalg0rithm
Last active August 29, 2015 14:01
Show Gist options
  • Save h0lyalg0rithm/1f08a4f1a7f9a32b70f4 to your computer and use it in GitHub Desktop.
Save h0lyalg0rithm/1f08a4f1a7f9a32b70f4 to your computer and use it in GitHub Desktop.
Postgres HStore
# /db/migrate/20140119134739_add_hstore.rb
class AddHstore < ActiveRecord::Migration
def up
enable_extension 'hstore'
end
def down
disable_extension 'hstore'
end
end
# /db/migrate/2014119134740_add_attr_to_image.rb
class AddAttrToImage < ActiveRecord::Migration
def change
add_column :images, :attr, :hstore
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment