I want to import the hasura metadata from CI/CD pipeline. I have tried using cli-migrations-v2 image. I am getting following error when it tries to import the metadata.
... level=fatal msg="failed to apply metadata: cannot apply metadata on the database: [parse-failed] expected 1 or 2, encountered 0 ($[1].version)"
The command I am using is as follows-
sudo docker run -d -p 8080:8080 --net=host --name=hasura-metadata-v2 -v /home/hasura_migrations/metadata:/hasura-metadata -e HASURA_GRAPHQL_DATABASE_URL=postgres://hasurauser:hasurauser@localhost:5432/new_db_migration -e HASURA_GRAPHQL_ENABLE_CONSOLE=true hasura/graphql-engine:v1.2.1.cli-migrations-v2
It is same as the one mentioned in the hasura documentation https://hasura.io/docs/1.0/graphql/manual/migrations/advanced/auto-apply-migrations.html#auto-apply-migrations