2020-01-14 15:57:45 +03:00
|
|
|
.. meta::
|
|
|
|
:description: Use hasura migrate create to create migration files for Hasura migrations with the Hasura CLI
|
|
|
|
:keywords: hasura, docs, CLI, hasura migrate create
|
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
.. _hasura_migrate_create:
|
|
|
|
|
|
|
|
Hasura CLI: hasura migrate create
|
|
|
|
---------------------------------
|
|
|
|
|
2019-09-11 10:17:14 +03:00
|
|
|
Create files required for a migration.
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
Synopsis
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
|
2019-09-11 10:17:14 +03:00
|
|
|
Create ``sql`` and ``yaml`` files required for a migration.
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
hasura migrate create [migration-name] [flags]
|
|
|
|
|
2019-12-02 13:57:17 +03:00
|
|
|
Examples
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
# Set up migration files for the first time by introspecting a server:
|
|
|
|
hasura migrate create "init" --from-server
|
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
Options
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2019-09-11 10:17:14 +03:00
|
|
|
--admin-secret string admin secret for Hasura GraphQL engine
|
|
|
|
--endpoint string http(s) endpoint for Hasura GraphQL engine
|
2019-12-02 13:57:17 +03:00
|
|
|
--from-server get SQL statements and Hasura metadata from the server
|
2019-03-18 19:40:04 +03:00
|
|
|
-h, --help help for create
|
|
|
|
--metadata-from-file string path to a hasura metadata file to be used for up actions
|
|
|
|
--metadata-from-server take metadata from the server and write it as an up migration file
|
2019-12-02 13:57:17 +03:00
|
|
|
--schema stringArray name of Postgres schema to export as a migration (default [public])
|
|
|
|
--sql-from-file string path to an SQL file which contains the SQL statements
|
|
|
|
--sql-from-server take pg_dump from the server and save it as a migration
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
Options inherited from parent commands
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2019-03-18 19:40:04 +03:00
|
|
|
--log-level string log level (DEBUG, INFO, WARN, ERROR, FATAL) (default "INFO")
|
2019-12-02 13:57:17 +03:00
|
|
|
--no-color do not colorize output (default: false)
|
2019-03-18 19:40:04 +03:00
|
|
|
--project string directory where commands are executed (default: current dir)
|
|
|
|
--skip-update-check Skip automatic update check on command execution
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
* :ref:`hasura migrate <hasura_migrate>` - Manage migrations on the database
|
|
|
|
|
|
|
|
*Auto generated by spf13/cobra*
|