Skip to content

Commit

Permalink
Change db config to use postgresql for development and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc committed May 5, 2015
1 parent 583a276 commit bc7bdfe
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ before_install:
- wget 'https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2'
- tar xf phantomjs-1.9.7-linux-x86_64.tar.bz2
- export PATH=$PATH:phantomjs-1.9.7-linux-x86_64/bin/
- psql -c "CREATE USER accounts WITH SUPERUSER PASSWORD 'accounts'" -U postgres
- psql -c 'CREATE DATABASE "accounts-testing" WITH OWNER accounts' -U postgres
install:
- bundle install
- bundle exec rake db:setup
- RAILS_ENV=test bundle exec rake db:setup
bundler_args: --without-production --retry=6
script:
- bundle exec rake
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ gem 'schema_plus', '~> 1.7.1'

gem 'aws-ses', '~> 0.6.0', :require => 'aws/ses'

gem 'pg'

group :assets do
gem 'sass-rails', '~> 3.2.6'
gem 'coffee-rails', '~> 3.2.1'
Expand All @@ -57,7 +59,6 @@ group :assets do
end

group :development, :test do
gem 'sqlite3'
gem 'debugger'
gem 'thin'
gem 'rspec-rails'
Expand All @@ -68,7 +69,6 @@ group :development, :test do
end

group :production do
gem 'pg'
gem 'unicorn'
gem 'lograge'
end
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.7)
squeel (1.1.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
Expand Down Expand Up @@ -371,7 +370,6 @@ DEPENDENCIES
sass-rails (~> 3.2.6)
schema_plus (~> 1.7.1)
smarter_csv
sqlite3
squeel
therubyracer
thin
Expand Down
16 changes: 8 additions & 8 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
adapter: postgresql
database: accounts
username: accounts
password: accounts

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
adapter: postgresql
database: accounts-testing
username: accounts
password: accounts

production:
adapter: postgresql
Expand Down
26 changes: 13 additions & 13 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,17 @@
end

create_table "oauth_applications", :force => true do |t|
t.string "name", :null => false
t.string "uid", :null => false
t.string "secret", :null => false
t.text "redirect_uri", :limit => 255, :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "trusted", :default => false
t.string "name", :null => false
t.string "uid", :null => false
t.string "secret", :null => false
t.text "redirect_uri", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "trusted", :default => false
t.integer "owner_id"
t.string "owner_type"
t.string "email_from_address", :default => "", :null => false
t.string "email_subject_prefix", :default => "", :null => false
t.string "email_from_address", :default => "", :null => false
t.string "email_subject_prefix", :default => "", :null => false
t.index ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type"
t.index ["uid"], :name => "index_oauth_applications_on_uid", :unique => true
end
Expand Down Expand Up @@ -248,11 +248,11 @@
t.string "uuid"
t.string "suffix"
t.string "state", :default => "temp", :null => false
t.index ["first_name"], :name => "index_users_on_first_name"
t.index ["full_name"], :name => "index_users_on_full_name"
t.index ["last_name"], :name => "index_users_on_last_name"
t.index ["first_name"], :name => "index_users_on_first_name", :case_sensitive => false
t.index ["full_name"], :name => "index_users_on_full_name", :case_sensitive => false
t.index ["last_name"], :name => "index_users_on_last_name", :case_sensitive => false
t.index ["username"], :name => "index_users_on_username", :unique => true
t.index ["username"], :name => "index_users_on_username_case_insensitive"
t.index ["username"], :name => "index_users_on_username_case_insensitive", :case_sensitive => false
t.index ["uuid"], :name => "index_users_on_uuid", :unique => true
end

Expand Down

0 comments on commit bc7bdfe

Please sign in to comment.