Skip to content

Commit

Permalink
change database from SQL lite to postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
kbhoffmann committed Mar 9, 2022
1 parent 89a0df0 commit b6caf48
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ ruby '2.7.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.6', '>= 5.2.6.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# gem 'sqlite3'
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ GEM
nio4r (2.5.8)
nokogiri (1.13.3-arm64-darwin)
racc (~> 1.4)
pg (1.3.3)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -159,7 +160,6 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
thor (1.2.1)
thread_safe (0.3.6)
tzinfo (1.2.9)
Expand All @@ -183,13 +183,13 @@ DEPENDENCIES
faraday
figaro
listen (>= 3.0.5, < 3.2)
pg
pry
puma (~> 3.11)
rails (~> 5.2.6, >= 5.2.6.2)
rspec-rails
shoulda-matchers
simplecov
sqlite3
tzinfo-data
vcr
webmock
Expand Down
10 changes: 6 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
# adapter: sqlite3
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

development:
<<: *default
database: db/development.sqlite3
# database: db/development.sqlite3
database: sweater_weather_development

# 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:
<<: *default
database: db/test.sqlite3
database: sweater_weather_test

production:
<<: *default
database: db/production.sqlite3
database: sweater_weather_production
3 changes: 3 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

ActiveRecord::Schema.define(version: 2022_03_06_215629) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "users", force: :cascade do |t|
t.string "email"
t.string "password_digest"
Expand Down

0 comments on commit b6caf48

Please sign in to comment.