diff --git a/Gemfile b/Gemfile index de74de092e..5ed4060f17 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index bc4500d7e6..228e70a540 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -462,6 +463,7 @@ DEPENDENCIES minitest minitest-ci pagy + pg puma pundit rails (~> 7.1.1) @@ -472,7 +474,6 @@ DEPENDENCIES simplecov spring sprockets - sqlite3 terser turbolinks tzinfo-data diff --git a/README.md b/README.md index 7da8ec41ab..35f0373606 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/config/database.yml.sample b/config/database.yml.sample index 78fcfad758..ad0dbbabc4 100644 --- a/config/database.yml.sample +++ b/config/database.yml.sample @@ -1,13 +1,13 @@ --- 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". @@ -15,9 +15,12 @@ development: 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") { '' } %>