Writing migrations manually (config v1)ΒΆ
While the Hasura Console can auto generate migrations for every action, sometimes you might want to write the migrations yourself, by hand. Using the Hasura CLI, you can bootstrap these migration files and write the SQL for the Postgres schema and YAML for Hasura metadata actions.
Set up the migration files:
hasura migrate create <name-of-migration>
This command will create up and down migration yaml files in the
migrations
directory.Edit the file and add your migration actions. For the file format and instructions on what actions can be added, refer to Migration file format reference (config v1).
Apply the migration:
hasura migrate apply
Was this page helpful?
Thank you for your feedback!
Stay up to date with product & security news
See past editions