Hasura CLI: hasura platform:migration apply¶
Apply all migrations on the cluster
Synopsis¶
Execute all or a specific number of migration steps (up, down). Specify the type of migration with flags, if no type is specified, an up migration is performed by default
hasura platform:migration apply [flags]
Examples¶
# To run forward migrations on a cluster:
$ hasura migration apply --up=all -c hasura
# To run a specific number of forward migrations:
$ hasura migration apply --up=3 -c hasura
# Similarly, To run backward migrations on a cluster:
$ hasura migration apply --down=all -c hasura
# To run a specific number of forward migrations:
$ hasura migration apply --down=3 -c hasura
# To specify all the migrations until a specified version
$ hasura migration apply --goto=[version]-c hasura
# Migration version is the first set of numbers appearing in a migration file's name
# e.g. the version is '1508137154' for a migration with filename 1508137154_create_table_author.up.yaml
Options¶
-c, --cluster string hasura cluster alias against which database migrations have to be applied
--down string apply all or N down migration steps
--goto string migrate the database to a specific version specified by the timestamp
-h, --help help for apply
--up string apply all or N up migration steps
Options inherited from parent commands¶
--project string hasura project directory where the commands should be executed. (default: current directory)
Was this page helpful?