Skip to content

Commit 41bc82b

Browse files
committed
Remove DATABASE_NAME env var for multi-database setup
- Use fixed database names (app_production, app_production_cache, etc.) - Let Rails handle multi-database naming convention automatically - Simplify production environment variables
1 parent 721ce97 commit 41bc82b

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

PRODUCTION_ENV.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Database Connection
77
DATABASE_HOST=your-postgres-host.com
88
DATABASE_PORT=5432
9-
DATABASE_NAME=pyramid_scheme_production # Base name, suffixes added automatically
109
DATABASE_USERNAME=your_db_user
1110
DATABASE_PASSWORD=your_secure_password
1211
```
@@ -40,10 +39,10 @@ GITHUB_CLIENT_SECRET=your_github_client_secret
4039
## Database Setup
4140

4241
Rails will automatically create these databases during deployment:
43-
- `pyramid_scheme_production` (main app data)
44-
- `pyramid_scheme_production_cache` (Rails cache)
45-
- `pyramid_scheme_production_queue` (background jobs)
46-
- `pyramid_scheme_production_cable` (websockets)
42+
- `app_production` (main app data)
43+
- `app_production_cache` (Rails cache)
44+
- `app_production_queue` (background jobs)
45+
- `app_production_cable` (websockets)
4746

4847
## Docker Deployment
4948

config/database.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,20 @@ test:
9292
production:
9393
primary: &primary_production
9494
<<: *default
95-
database: <%= ENV.fetch("DATABASE_NAME") { "app_production" } %>
95+
database: app_production
9696
username: <%= ENV.fetch("DATABASE_USERNAME") { "app" } %>
9797
password: <%= ENV["DATABASE_PASSWORD"] %>
9898
host: <%= ENV.fetch("DATABASE_HOST") { "localhost" } %>
9999
port: <%= ENV.fetch("DATABASE_PORT") { 5432 } %>
100100
cache:
101101
<<: *primary_production
102-
database: <%= ENV.fetch("DATABASE_NAME") { "app_production" } %>_cache
102+
database: app_production_cache
103103
migrations_paths: db/cache_migrate
104104
queue:
105105
<<: *primary_production
106-
database: <%= ENV.fetch("DATABASE_NAME") { "app_production" } %>_queue
106+
database: app_production_queue
107107
migrations_paths: db/queue_migrate
108108
cable:
109109
<<: *primary_production
110-
database: <%= ENV.fetch("DATABASE_NAME") { "app_production" } %>_cable
110+
database: app_production_cable
111111
migrations_paths: db/cable_migrate

0 commit comments

Comments
 (0)