Upgrading to Hasura migrations config v2
What has changed?
In config v1, the PG schema migrations and Hasura metadata were both
handled using the same migration files
which were in
yaml format. In config v2, these are managed
separately in their own directories in the Hasura project. Metadata is
managed in its separate metadata directory and PG
schema migrations are managed via
migration files that are now in
Changes needed in existing workflows
Due to the above mentioned changes, any workflows that involve applying migrations have an additional step of applying metadata as well.
- any place where the
hasura migrate applycommand is used, it now needs to be followed by a
hasura metadata applycommand.
- if the
cli-migrationsDocker image is used for auto applying migrations at server start, now you will have to use the
cli-migrations-v2image and the
/metadatadirectory will also have to be mounted along with the
Step 0: Take a backup
Make sure you take a backup of your Hasura project before upgrading to
Step 1: Upgrade to the latest CLI
Config v2 is available since
Step 2: Upgrade hasura project to v2
In your project directory, run:
hasura scripts update-project-v2
Your project directory and
config.yaml should be updated to v2.