Hasura CLI: hasura platform:migration create

Create files required for a migration

Synopsis

Create sql and yaml files required for a migration

hasura platform:migration create [migration-name] [flags]

Alias: generate

Examples

# Create the sql and yaml files required for a migration:
$ hasura migration create migration-name

# after creating these files, edit them to add required migration steps
# for e.g, edit [timestamp]_[name].up.yaml to add all the 'up' Hasura Data API operations as an array of objects
#          edit [timestamp]_[name].down.yaml to add all the 'down' Hasura Data API operations
#          edit [timestamp]_[name].up.sql to add all the SQL 'up' operations
#          edit [timestamp]_[name].down.sql to add all the SQL 'down' operations

# for more details on how to write migration by hand, refer to:
# https://docs.hasura.io/0.15/manual/data/data-migration.html

# To create migrations easily using a UI, use api-console
$ hasura api-console

Options

-h, --help   help for create

Options inherited from parent commands

--project string   hasura project directory where the commands should be executed. (default: current directory)

SEE ALSO

Auto generated by spf13/cobra