An open API service indexing awesome lists of open source software.

https://github.com/fpopic/docker-postgres-adminer-goose

(POC) Manage postgres migrations (db versioning) using goose
https://github.com/fpopic/docker-postgres-adminer-goose

adminer docker-compose goose goose-migration postgres

Last synced: about 1 month ago
JSON representation

(POC) Manage postgres migrations (db versioning) using goose

Awesome Lists containing this project

README

          

# docker-postgres-adminer-goose

Dockerized example of how to set up db-migrations using goose that could be used by humans or machines (CI).
Adminer was added so the user can explore db-migrations internal log.

Used:
- [goose](https://github.com/pressly/goose)

Steps:
1. Clone the repository
```shell script
git clone git@github.com:fpopic/docker-postgres-adminer-goose.git
cd docker-postgres-adminer-goose
```

1. Spin up composed services: `postgres`, `adminer`, `goose` with Dockerfile entrypoint
```shell script
docker-compose up --build
```

1. Run goose standalone:
```shell script
docker-compose run goose status
docker-compose run goose create sql
# edit db/migrations/.sql
docker-compose run goose up
```

1. Check changes in adminer:
```shell script
open 'http://localhost:8080/?pgsql=migrations-postgres&username=goose&db=goose&ns=public'
```