Skip to content

Commit

Permalink
Add sqlite3 gem and adapter
Browse files Browse the repository at this point in the history
for development and testing
  • Loading branch information
amd-9 committed Jul 11, 2021
1 parent 555580a commit f45a1b0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -7,6 +7,8 @@ ruby '3.0.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.4'
# Use sqlite3 as the database for Active Record - for testing and development environment
gem 'sqlite3', '~> 1.4'
# Use Postgres as the database for Active Record
gem 'pg'
# Use Puma as the app server
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -193,6 +193,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
thor (1.1.0)
tilt (2.0.10)
turbolinks (5.2.1)
Expand Down Expand Up @@ -241,6 +242,7 @@ DEPENDENCIES
sass-rails (>= 6)
selenium-webdriver
spring
sqlite3 (~> 1.4)
turbolinks (~> 5)
tzinfo-data
web-console (>= 4.1.0)
Expand Down
7 changes: 4 additions & 3 deletions config/database.yml
@@ -1,19 +1,20 @@
default: &default
adapter: postgresql
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

development:
<<: *default
database: ruby_magic_blog_development
database: db/development.sqlite3

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

production:
<<: *default
database: ruby_magic_blog_production
url: <%= ENV['DATABASE_URL'] %>
15 changes: 15 additions & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f45a1b0

Please sign in to comment.