プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
0

Configure Feed

Select the types of activity you want to include in your feed.

create postgres migration

Kohei Watanabe (Sep 16, 2023, 3:41 PM +0900) 8e62760d 966a3a2e

+55
+2
postgres-migration/.env
··· 1 + # touch .env && chmod 600 .env && echo POSTGRES_PASSWORD=$(openssl rand -hex 32) >> .env 2 + POSTGRES_PASSWORD=18bc0402c8e8a7d95ed49c2d9b93a4cae9d5970c9fc6c6f328977b93f77bb48a
+40
postgres-migration/compose.yml
··· 1 + services: 2 + pgadmin: 3 + image: dpage/pgadmin4 4 + ports: 5 + - "8080:80" 6 + environment: 7 + PGADMIN_DEFAULT_EMAIL: postgres@db.host.docker.internal 8 + PGADMIN_DEFAULT_PASSWORD: ${POSTGRES_PASSWORD:?} 9 + volumes: 10 + - ./servers.json:/pgadmin4/servers.json:ro 11 + db: 12 + image: postgres:16-alpine 13 + environment: 14 + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?} 15 + volumes: 16 + - postgres_data_v16:/var/lib/postgresql/data 17 + # - postgres_data_v17:/var/lib/postgresql/data 18 + old_db: 19 + profiles: 20 + - migration 21 + image: postgres:16-alpine 22 + # image: postgres:16-alpine 23 + environment: 24 + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?} 25 + volumes: 26 + - postgres_data_v16:/var/lib/postgresql/data 27 + volumes: 28 + postgres_data_v16: 29 + # postgres_data_v17: 30 + # docker compose down 31 + # editor compose.yml 32 + # add new version volume 33 + # replace old_db.image new → old version 34 + # replace db.volumes old → new version 35 + # docker compose --profile=migration up -d old_db db 36 + # docker compose exec old_db pg_dumpall --clean -U postgres | docker compose exec -T db psql -U postgres 37 + # docker compose up -d 38 + # docker compose --profile=migration down old_db 39 + # editor compose.yml 40 + # remove volume
+13
postgres-migration/servers.json
··· 1 + { 2 + "Servers": { 3 + "1": { 4 + "Name": "postgres@db", 5 + "Group": "docker", 6 + "Port": 5432, 7 + "Username": "postgres", 8 + "Host": "db", 9 + "SSLMode": "prefer", 10 + "MaintenanceDB": "postgres" 11 + } 12 + } 13 + }