From 89ccd7fd2aa06c6be77028aca74b965493f94d8d Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Sun, 11 Dec 2022 10:09:04 -0500 Subject: [PATCH] add note about `db:migrate` --- notes/postgres.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/notes/postgres.md b/notes/postgres.md index 0598b74..f175b68 100644 --- a/notes/postgres.md +++ b/notes/postgres.md @@ -19,6 +19,14 @@ echo "pgbouncer password (save this securely): $DB_PASSWORD" echo "CREATE USER pgbouncer WITH PASSWORD '$DB_PASSWORD' CREATEDB" | sudo -u postgres psql -f - ``` +#### Running database migrations + +Mastodon `db:migrate`s should be pointed directly at Postgres (default port: 5432), ***not through PgBouncer***, by overriding `DB_PORT` env variable. + +```bash +RAILS_ENV=production DB_PORT=5432 bundle exec rails db:migrate +``` + #### Config .env.production: @@ -67,6 +75,10 @@ generate md5 hash of postgres passwords with `echo -n "pass" | md5sum` ## Connecting from TablePlus.app via Tailscale +Connect directly to Postgres (default port: 5432), ***not via PgBouncer!*** + +--- + /etc/postgresql/15/main/postgres.conf ```