Skip to content

Commit

Permalink
Add support for psql and add dotenv gem for env variables. #12
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadmil committed Oct 21, 2017
1 parent 781fb99 commit 344215e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DB_USERNAME=
DB_PASSWORD=
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

group :development do
gem 'sqlite3'
gem 'pg'
gem 'meta_request'
gem 'web-console'
gem "awesome_print", require:"ap"
Expand All @@ -29,6 +30,7 @@ group :development, :test do
gem 'rspec-rails', '~> 3.6'
gem 'bullet', '~> 5.6'
gem 'bundler-audit', '~> 0.6', require: false
gem 'dotenv-rails'
end

group :test do
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ GEM
docile (1.1.5)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1)
dotenv-rails (2.2.1)
dotenv (= 2.2.1)
railties (>= 3.2, < 5.2)
equalizer (0.0.11)
erubis (2.7.0)
execjs (2.7.0)
Expand Down Expand Up @@ -215,6 +219,8 @@ GEM
parser (2.4.0.0)
ast (~> 2.2)
path_expander (1.0.2)
pg (0.21.0)
pg (0.21.0-x86-mingw32)
powerpack (0.1.1)
procto (0.0.3)
public_suffix (3.0.0)
Expand Down Expand Up @@ -410,6 +416,7 @@ DEPENDENCIES
coffee-rails (~> 4.2)
database_cleaner (~> 1.6)
devise
dotenv-rails
factory_girl_rails (~> 4.6)
faker (~> 1.7)
fuubar (~> 2.2.0)
Expand All @@ -420,6 +427,7 @@ DEPENDENCIES
meta_request
metric_fu (~> 4.12.0)
paperclip
pg
puma (~> 3.0)
rails (~> 5.0.1)
rails_admin
Expand Down
28 changes: 21 additions & 7 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
# IF YOU WANT TO USE POSTGRESQL FOR DEVELOPMENT!!!!
default: &default
adapter: sqlite3
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: 5
timeout: 5000
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
<<: *default
database: db/development.sqlite3
database: beeconnect_development
# username: <%= ENV['DB_USERNAME'] %>
# password: <%= ENV['DB_PASSWORD'] %>

test:
<<: *default
database: db/test.sqlite3
# default: &default
# adapter: sqlite3
# # For details on connection pooling, see rails configuration guide
# # http://guides.rubyonrails.org/configuring.html#database-pooling
# pool: 5
# timeout: 5000
#
# development:
# <<: *default
# database: db/development.sqlite3
#
# test:
# <<: *default
# database: db/test.sqlite3

production:
adapter: mysql2
Expand Down

0 comments on commit 344215e

Please sign in to comment.