Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
feat: 🎸 RDBMS を MySQL から PostgreSQL に変更した (#148)
Browse files Browse the repository at this point in the history
* feat: 🎸 RDBMS を MySQL から PostgreSQL に変更した

* ci: 🎡 CircleCI は不要になったので削除
  • Loading branch information
nikukyugamer authored Nov 19, 2022
1 parent 3396089 commit 32e3947
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 104 deletions.
79 changes: 0 additions & 79 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ gem 'coffee-rails'
gem 'dotenv-rails'
gem 'jbuilder'
gem 'kaminari'
gem 'mysql2'
gem 'nokogiri'
gem 'pg'
gem 'puma'
gem 'rails'
gem 'sass-rails'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ GEM
mini_mime (1.1.2)
minitest (5.16.3)
multipart-post (2.2.3)
mysql2 (0.5.4)
naught (1.1.0)
net-imap (0.3.1)
net-protocol
Expand All @@ -175,6 +174,7 @@ GEM
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
pg (1.4.5)
public_suffix (5.0.0)
puma (6.0.0)
nio4r (~> 2.0)
Expand Down Expand Up @@ -334,8 +334,8 @@ DEPENDENCIES
jbuilder
kaminari
listen
mysql2
nokogiri
pg
puma
rails
rspec-rails
Expand Down
46 changes: 24 additions & 22 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
default: &default
adapter: mysql2
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
adapter: postgresql
encoding: unicode
pool: <%= ENV['RAILS_MAX_THREADS'] || 5 %>
timeout: 5000
encoding: utf8mb4
strict: false
host: <%= ENV.fetch('MYSQL_HOST') %>
port: <%= ENV.fetch('MYSQL_PORT') %>
username: <%= ENV.fetch('MYSQL_USERNAME') %>
password: <%= ENV.fetch('MYSQL_PASSWORD') %>

development:
<<: *default
host: <%= ENV['MYSQL_HOST_DEVELOPMENT'] || ENV.fetch('MYSQL_HOST') %>
port: <%= ENV['MYSQL_PORT_DEVELOPMENT'] || ENV.fetch('MYSQL_PORT') %>
username: <%= ENV['MYSQL_USERNAME_DEVELOPMENT'] || ENV.fetch('MYSQL_USERNAME') %>
password: <%= ENV['MYSQL_PASSWORD_DEVELOPMENT'] || ENV.fetch('MYSQL_PASSWORD') %>
database: <%= ENV['MYSQL_DATABASE_DEVELOPMENT'] || 'suikoden_election_2017_development' %>
host: <%= ENV['PG_HOST_DEVELOPMENT'] || 'localhost' %>
port: <%= ENV['PG_PORT_DEVELOPMENT'] || 5432 %>
username: <%= ENV['PG_USERNAME_DEVELOPMENT'] || 'root' %>
password: <%= ENV['PG_PASSWORD_DEVELOPMENT'] || 'password' %>
database: <%= ENV['PG_DATABASE_DEVELOPMENT'] || 'gss2017_development' %>
template: template0
collation: ja_JP.UTF-8
ctype: ja_JP.UTF-8

production:
<<: *default
host: <%= ENV['MYSQL_HOST_PRODUCTION'] || ENV.fetch('MYSQL_HOST') %>
port: <%= ENV['MYSQL_PORT_PRODUCTION'] || ENV.fetch('MYSQL_PORT') %>
username: <%= ENV['MYSQL_USERNAME_PRODUCTION'] || ENV.fetch('MYSQL_USERNAME') %>
password: <%= ENV['MYSQL_PASSWORD_PRODUCTION'] || ENV.fetch('MYSQL_PASSWORD') %>
database: <%= ENV['MYSQL_DATABASE_PRODUCTION'] || 'suikoden_election_2017_production' %>
host: <%= ENV['PG_HOST_PRODUCTION'] || 'localhost' %>
port: <%= ENV['PG_PORT_PRODUCTION'] || 5432 %>
username: <%= ENV['PG_USERNAME_PRODUCTION'] || 'root' %>
password: <%= ENV['PG_PASSWORD_PRODUCTION'] || 'password' %>
database: <%= ENV['PG_DATABASE_PRODUCTION'] || 'gss2017_production' %>
template: template0
collation: ja_JP.UTF-8
ctype: ja_JP.UTF-8

test:
<<: *default
host: <%= ENV['MYSQL_HOST_TEST'] || '127.0.0.1' %>
port: <%= ENV['MYSQL_PORT_TEST'] || 3306 %>
username: <%= ENV['MYSQL_USERNAME_TEST'] || 'gss2017' %>
password: <%= ENV['MYSQL_PASSWORD_TEST'] || 'gss2017_pasword' %>
database: <%= ENV['MYSQL_DATABASE_TEST'] || 'suikoden_election_2017_test' %>
host: <%= ENV['PG_HOST_TEST'] || 'localhost' %>
port: <%= ENV['PG_PORT_TEST'] || 5432 %>
username: <%= ENV['PG_USERNAME_TEST'] || 'gss2017' %>
password: <%= ENV['PG_PASSWORD_TEST'] || 'gss2017_password' %>
database: <%= ENV['PG_DATABASE_TEST'] || 'gss2017_test' %>

0 comments on commit 32e3947

Please sign in to comment.