Skip to content

Commit 9695366

Browse files
committed
Change database to postgres from sqlite3
1 parent d10983d commit 9695366

4 files changed

Lines changed: 39 additions & 6 deletions

File tree

Gemfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ end
99
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
1010
gem 'rails', '~> 5.0.1'
1111
# Use sqlite3 as the database for Active Record
12-
gem 'sqlite3'
12+
1313
# Use Puma as the app server
1414
gem 'puma', '~> 3.0'
1515
# Use SCSS for stylesheets
@@ -39,6 +39,7 @@ gem 'jbuilder', '~> 2.5'
3939
group :development, :test do
4040
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
4141
gem 'byebug', platform: :mri
42+
gem 'sqlite3'
4243
end
4344

4445
group :development do
@@ -50,5 +51,9 @@ group :development do
5051
gem 'spring-watcher-listen', '~> 2.0.0'
5152
end
5253

54+
group :production do
55+
gem 'pg'
56+
end
57+
5358
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
5459
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ GEM
9191
nio4r (2.1.0)
9292
nokogiri (1.7.2)
9393
mini_portile2 (~> 2.1.0)
94+
pg (0.21.0)
9495
puma (3.9.0)
9596
rack (2.0.3)
9697
rack-test (0.6.3)
@@ -172,6 +173,7 @@ DEPENDENCIES
172173
jbuilder (~> 2.5)
173174
jquery-rails
174175
listen (~> 3.0.5)
176+
pg
175177
puma (~> 3.0)
176178
rails (~> 5.0.1)
177179
sass-rails (~> 5.0)
@@ -184,4 +186,4 @@ DEPENDENCIES
184186
web-console (>= 3.3.0)
185187

186188
BUNDLED WITH
187-
1.14.6
189+
1.15.1

config/database.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ default: &default
1111

1212
development:
1313
<<: *default
14-
database: db/development.sqlite3
14+
adapter: postgresql
15+
database: my_database_development
16+
pool: 5
17+
timeout: 5000
1518

1619
# Warning: The database defined as "test" will be erased and
1720
# re-generated from your development database when you run "rake".
1821
# Do not set this db to the same as development or production.
1922
test:
2023
<<: *default
21-
database: db/test.sqlite3
24+
adapter: postgresql
25+
database: my_database_development
26+
pool: 5
27+
timeout: 5000
2228

2329
production:
24-
<<: *default
25-
database: db/production.sqlite3
30+
adapter: postgresql
31+
database: my_database_development
32+
pool: 5
33+
timeout: 5000

db/schema.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is auto-generated from the current state of the database. Instead
2+
# of editing this file, please use the migrations feature of Active Record to
3+
# incrementally modify your database, and then regenerate this schema definition.
4+
#
5+
# Note that this schema.rb definition is the authoritative source for your
6+
# database schema. If you need to create the application database on another
7+
# system, you should be using db:schema:load, not running all the migrations
8+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
9+
# you'll amass, the slower it'll run and the greater likelihood for issues).
10+
#
11+
# It's strongly recommended that you check this file into your version control system.
12+
13+
ActiveRecord::Schema.define(version: 0) do
14+
15+
# These are extensions that must be enabled in order to support this database
16+
enable_extension "plpgsql"
17+
18+
end

0 commit comments

Comments
 (0)