Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 960 Bytes

File metadata and controls

32 lines (26 loc) · 960 Bytes

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:

Steps:

  1. Clone the repository

    git clone git@github.com:fpopic/docker-postgres-adminer-goose.git
    cd docker-postgres-adminer-goose
  2. Spin up composed services: postgres, adminer, goose with Dockerfile entrypoint

    docker-compose up --build
  3. Run goose standalone:

    docker-compose run goose status
    docker-compose run goose create <name_of_migration> sql
    # edit db/migrations/<name_of_migration>.sql
    docker-compose run goose up
  4. Check changes in adminer:

    open 'http://localhost:8080/?pgsql=migrations-postgres&username=goose&db=goose&ns=public'