Skip to content

Commit

Permalink
update postgres.md
Browse files Browse the repository at this point in the history
  • Loading branch information
smajti1 committed Mar 8, 2024
1 parent 5c7dba3 commit 66bd951
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/phpstan-analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install php
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
ports:
- ${DB_PORT}:${DB_PORT}
- ${DB_PORT}:5432
networks:
- fakturomat-net

Expand Down
7 changes: 6 additions & 1 deletion docs/postgres.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
### upgrade major version

In this step pay attention in:
- command `docker compose up -d` may create postgres users/database
- pgdump file may have code to remove actual selected user/database

Dump database to file

DB_DATABASE and DB_USERNAME variable take from .env file
DB_DATABASE and DB_USERNAME variable take from .env file

docker compose exec db pg_dump --no-owner --dbname=DB_DATABASE --username=DB_USERNAME > pgdump.sql

Expand All @@ -21,3 +22,7 @@ Download pgdump.sql from server
scp USERNAME@IP_ADDRESS:prod/fakturomat/pgdump.sql .

https://www.postgresql.org/docs/current/app-pgdump.html

### connect to db

docker compose exec postgres-db psql --password --dbname=$DB_DATABASE --username=$DB_USERNAME

0 comments on commit 66bd951

Please sign in to comment.