PostgreSQL 11, Docker, Docker Compose, & Make
$ make
$ MIGRATION_PATH=<your_path_to>/graphql-gateway make migrate-init
$ MIGRATION_PATH=<your_path_to>/graphql-gateway make migrate-up
Starting the container & app
$ make compose-up
Stopping the container & app
$ make compose-down
$ MIGRATION_PATH=<your_path_to>/graphql-gateway make migrate-up
$ make test
Database migrations for this app use golang-migrate/migrate command-line utility. To simply run existing migration you do not need to download the dependancy. We are running the migration commands via a docker container. However if you want to generate the files you can download/install it locally following these instructions: https://github.com/golang-migrate/migrate/tree/master/cli and running the following command: migrate -ext sql -dir sql/migrations -seq -digits 4 <name_of_migration>
Read more about migration best practices here Read more about cli commands here
Migrate the initial setup. Requires RDS admin credentials.
$ MIGRATION_PATH=<your_path_to>/graphql-gateway make migrate-init
Migrate changes up
$ MIGRATION_PATH=<your_path_to>/graphql-gateway make migrate-up
Migate the changes down
make migrate-down
Force migate starting at an existing version
make migrate-force -v=<migration_version_number>