Skip to content

Commit

Permalink
Using pg in yai branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Guo committed Nov 13, 2023
1 parent 8a6e11c commit ffa574e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ gem 'rails-i18n'
# released.
gem 'mail', '= 2.8.1'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'pg'
# Use Puma as the app server
gem 'puma'
# Use jquery as the JavaScript library
Expand Down
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ GEM
racc (~> 1.4)
orm_adapter (0.5.0)
pagy (6.2.0)
pg (1.5.4)
psych (5.1.1.1)
stringio
public_suffix (5.0.3)
Expand Down Expand Up @@ -462,6 +463,7 @@ DEPENDENCIES
minitest
minitest-ci
pagy
pg
puma
pundit
rails (~> 7.1.1)
Expand All @@ -472,7 +474,6 @@ DEPENDENCIES
simplecov
spring
sprockets
sqlite3
terser
turbolinks
tzinfo-data
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rm config/credentials.yml.enc
export EDITOR=vim
# paste credentials.yml.sample or skip
bin/rails credentials:edit
bin/rails db:create
bin/rails test:all
```

Expand Down
11 changes: 7 additions & 4 deletions config/database.yml.sample
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
---
default: &default
adapter: sqlite3
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

development:
primary:
<<: *default
database: storage/oauth2id_dev.sqlite3
database: <%= ENV.fetch("OAUTH2ID_DEV_DB_NAME") { 'oauth2id_dev' } %>

# 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:
primary:
<<: *default
database: storage/oauth2id_test.sqlite3
database: <%= ENV.fetch("OAUTH2ID_TEST_DB_NAME") { 'oauth2id_test' } %>

production:
primary:
<<: *default
database: storage/oauth2id_prod.sqlite3
database: <%= ENV.fetch("OAUTH2ID_DB_NAME") { 'oauth2id_prod' } %>
username: <%= ENV.fetch("OAUTH2ID_DB_USERNAME") { '' } %>
password: <%= ENV.fetch("OAUTH2ID_DB_PASSWORD") { '' } %>
host: <%= ENV.fetch("OAUTH2ID_DB_HOST") { '' } %>

0 comments on commit ffa574e

Please sign in to comment.