BREW OAUTH SERVER HASURA

Run

The following command can be executed to up a local hasura environment:

docker-compose up -d

Applying Migrations

Hasura service in our docker environment applies found migrations in its migration folder automatically on start.

So, after getting changes from master branch with:

git pull

Containers should be up with:

docker-compose up -d

or if they are already up, just restart them:

docker-compose restart

That's all. All migrations will be applied in your local server.

Reaching Hasura Console

Windows

cd oauth-server
npx hasura console --admin-secret secret --api-host http://localhost --api-port 9693

Update Database

npm i

hasura metadata apply --endpoint {ENDPOINT_URL}  --admin-secret "{ADMIN_SECRET}"" --project oauth-server

npx hasura migrate apply --endpoint {ENDPOINT_URL}  --admin-secret "{ADMIN_SECRET}"" --project oauth-server --database-name oauth

Squashing Migrations

The following command can be executed to squash migrations into one migration from version 1589810113314

docker-compose exec hasura hasura-cli migrate squash --name "<name>" --from 1589810113314

For detailed information see:

Hasura CLI: hasura migrate squash