.. meta:: :description: Use hasura migrate apply to apply Hasura migrations on a database with the Hasura CLI :keywords: hasura, docs, CLI, hasura migrate apply .. _hasura_migrate_apply: Hasura CLI: hasura migrate apply -------------------------------- Apply migrations on the database. Synopsis ~~~~~~~~ Apply migrations on the database. :: hasura migrate apply [flags] Examples ~~~~~~~~ :: # Apply all migrations hasura migrate apply # Use with admin secret: hasura migrate apply --admin-secret "" # Apply migrations on another Hasura instance: hasura migrate apply --endpoint "" # Mark migration as applied on the server and skip execution: hasura migrate apply --skip-execution # Apply a particular migration version only: hasura migrate apply --version "" # Apply last 2 down migrations: hasura migrate apply --down 2 # Apply only 2 up migrations: hasura migrate apply --up 2 # Apply only a particular version hasura migrate apply --type up --version "" # Apply all up migrations upto version 125, last applied is 100 hasura migrate apply --goto 125 # Apply all down migrations upto version 125, last applied is 150 hasura migrate apply --goto 125 # Rollback a particular version: hasura migrate apply --type down --version "" # Rollback all migrations: hasura migrate apply --down all Options ~~~~~~~ :: --up string apply all or N up migration steps --down string apply all or N down migration steps --goto string apply migration chain up to to the version specified --version string only apply this particular migration --skip-execution skip executing the migration action, but mark them as applied --type string type of migration (up, down) to be used with version flag (default "up") -h, --help help for apply Options inherited from parent commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: --admin-secret string admin secret for Hasura GraphQL engine --endpoint string http(s) endpoint for Hasura GraphQL engine --log-level string log level (DEBUG, INFO, WARN, ERROR, FATAL) (default "INFO") --no-color do not colorize output (default: false) --project string directory where commands are executed (default: current dir) --skip-update-check skip automatic update check on command execution SEE ALSO ~~~~~~~~ * :ref:`hasura migrate ` - Manage migrations on the database *Auto generated by spf13/cobra*