diff --git a/Gemfile b/Gemfile index f4fb98b..1636cf3 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index fd02cf4..969fb75 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) @@ -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 diff --git a/config/database.yml b/config/database.yml index 0d02f24..1b7088d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 6a1f4a5..271ee2b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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"