Skip to content

Instantly share code, notes, and snippets.

@bru
Created August 4, 2012 14:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bru/3258069 to your computer and use it in GitHub Desktop.
Save bru/3258069 to your computer and use it in GitHub Desktop.
Sinatra HStore setup
source :rubygems gem "sinatra"
gem "pg" gem "activerecord-postgres-hstore"
gem "sinatra-activerecord"
class Setuphstore < ActiveRecord::Migration
def up
execute "CREATE EXTENSION hstore"
end
def down
execute "DROP EXTENSION hstore"
end
end
class CreateSettings < ActiveRecord::Migration
def up
create_table :settings do |t|
t.string :name
t.hstore :data
t.timestamps
end
end
def down
drop_table :settings
end
end
require 'sinatra/activerecord/rake'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment