Skip to content

Instantly share code, notes, and snippets.

@leemour
Created April 6, 2013 13:58
Show Gist options
  • Save leemour/5326209 to your computer and use it in GitHub Desktop.
Save leemour/5326209 to your computer and use it in GitHub Desktop.
Changing defaults in :production from sqlite to pg
#=> config/database.rb
postgres = URI.parse(ENV['DATABASE_URL'] || '')
ActiveRecord::Base.configurations[:production] = {
:adapter => 'postgresql',
:encoding => 'utf8',
:database => postgres.path[1..-1],
:username => postgres.user,
:password => postgres.password,
:host => postgres.host
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment