mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 20:41:49 +03:00
94 lines
2.6 KiB
ReStructuredText
94 lines
2.6 KiB
ReStructuredText
.. 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 "<admin-secret>"
|
|
|
|
# Apply migrations on another Hasura instance:
|
|
hasura migrate apply --endpoint "<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 "<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 "<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 "<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 <hasura_migrate>` - Manage migrations on the database
|
|
|
|
*Auto generated by spf13/cobra*
|