Only have to do this bit the first time
hasura init data-cli --endpoint http://localhost:8081 --admin-secret hello-this-is-my-admin-secret
cd data-cli/
hasura migrate create "init" --from-server --database-name default
hasura migrate apply --skip-execution --version <version-number-from-prev-migrate-command> --database-name default
hasura metadata export
Every other time start here
hasura console
now make the changes in the console...
hasura metadata export
hasura migrate status --database-name default
have a look... hopefull all migrations are present and present
hasura migrate squash --name "<make up a name>" --from <oldest version in above list> --database-name default
have a look... hopefull just one migration and should be Present | Not present
hasura migrate status --database-name default
this next line may fail if changes are already made (no stress)
hasura migrate apply --version <the new version name> --skip-execution --database-name default
have a look... hshould now be Present | Present
hasura migrate status --database-name default
Now make sure hasura imports the migrations at startup (in docker-compose.yaml ...)
...
restart: always
volumes:
- ./<localtion relative to src>/migrations:/hasura-migrations
- ./<localtion relative to src>/metadata:/hasura-metadata
environment:
...