aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-10-28 20:36:27 -0400
committerRaghuram Subramani <raghus2247@gmail.com>2025-10-28 20:36:27 -0400
commite4d77fc45ea695d1f3775e04c596d2a35584fbcd (patch)
tree9c1d9095f9c265526098cddc891ee86c5b6c4188
parent6b23594f26abf0697c022e02c77cb9f52077f3f0 (diff)
sqlite->postgres
-rw-r--r--.gitignore1
-rw-r--r--Dockerfile2
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock17
-rw-r--r--config/database.yml21
5 files changed, 16 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index fbcab40..314f1f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,4 @@
# Ignore key files for decrypting credentials and more.
/config/*.key
+/pgdata/
diff --git a/Dockerfile b/Dockerfile
index d2c7943..db979be 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,7 +16,7 @@ WORKDIR /rails
# Install base packages
RUN apt-get update -qq && \
- apt-get install --no-install-recommends -y curl libjemalloc2 sqlite3 && \
+ apt-get install --no-install-recommends -y curl libjemalloc2 && \
ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
diff --git a/Gemfile b/Gemfile
index b84bb1a..d5188d1 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,8 +4,7 @@ source "https://rubygems.org"
gem "rails", "~> 8.1.1"
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
gem "propshaft"
-# Use sqlite3 as the database for Active Record
-gem "sqlite3", ">= 2.1"
+gem "pg"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", ">= 5.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
diff --git a/Gemfile.lock b/Gemfile.lock
index e52da16..ee6745b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -157,6 +157,13 @@ GEM
parser (3.3.10.0)
ast (~> 2.4.1)
racc
+ pg (1.6.2)
+ pg (1.6.2-aarch64-linux)
+ pg (1.6.2-aarch64-linux-musl)
+ pg (1.6.2-arm64-darwin)
+ pg (1.6.2-x86_64-darwin)
+ pg (1.6.2-x86_64-linux)
+ pg (1.6.2-x86_64-linux-musl)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
@@ -248,14 +255,6 @@ GEM
rubocop-rails (>= 2.30)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
- sqlite3 (2.7.4-aarch64-linux-gnu)
- sqlite3 (2.7.4-aarch64-linux-musl)
- sqlite3 (2.7.4-arm-linux-gnu)
- sqlite3 (2.7.4-arm-linux-musl)
- sqlite3 (2.7.4-arm64-darwin)
- sqlite3 (2.7.4-x86_64-darwin)
- sqlite3 (2.7.4-x86_64-linux-gnu)
- sqlite3 (2.7.4-x86_64-linux-musl)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.7)
@@ -306,11 +305,11 @@ DEPENDENCIES
bundler-audit
debug
importmap-rails
+ pg
propshaft
puma (>= 5.0)
rails (~> 8.1.1)
rubocop-rails-omakase
- sqlite3 (>= 2.1)
stimulus-rails
thruster
turbo-rails
diff --git a/config/database.yml b/config/database.yml
index 8079641..b9accb3 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -1,32 +1,21 @@
-# SQLite. Versions 3.8.0 and up are supported.
-# gem install sqlite3
-#
-# Ensure the SQLite 3 gem is defined in your Gemfile
-# gem "sqlite3"
-#
default: &default
- adapter: sqlite3
+ adapter: postgresql
max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
development:
<<: *default
- database: storage/development.sqlite3
+ database: monzieur
+ host: <%= Dir.pwd %>/pgdata
# 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:
+ database: monzieur
<<: *default
- database: storage/test.sqlite3
-# SQLite3 write its data on the local filesystem, as such it requires
-# persistent disks. If you are deploying to a managed service, you should
-# make sure it provides disk persistence, as many don't.
-#
-# Similarly, if you deploy your application as a Docker container, you must
-# ensure the database is located in a persisted volume.
production:
<<: *default
- # database: path/to/persistent/storage/production.sqlite3
+ database: monzieur_prod # TODO: update