Graphql-engine: create migration doesn't backup metadata in v1.2.0-beta.1

Created on 2 Mar 2020  路  3Comments  路  Source: hasura/graphql-engine

Using the latest v1.2.0-beta.1 cli and server, the command hasura migrate create "init" --from-server doesn't store metadata files.

Steps to reproduce:

  • Create a fresh instance with docker for example
  • Add a table
  • Track it
  • run hasura init --directory hasura --endpoint http://localhost:8080
  • run hasura migrate create "init" --from-server

It creates an SQL migration script as expected in the migration folder. But the files under metada are not touched. for example, tables.yam contains only [].

Am I missing something ?

cli docs migrations

Most helpful comment

@EmrysMyrddin The new workflow introduced with 1.2.0-beta.1 moves all metadata related actions under metadata command. migrate command is exclusively used for managing SQL migrations.

To export both SQL schema and Hasura metadata, you should execute the following commands:

hasura migrate create init --from-server
hasura metadata export

We'll be adding proper docs for this soon.

All 3 comments

@EmrysMyrddin The new workflow introduced with 1.2.0-beta.1 moves all metadata related actions under metadata command. migrate command is exclusively used for managing SQL migrations.

To export both SQL schema and Hasura metadata, you should execute the following commands:

hasura migrate create init --from-server
hasura metadata export

We'll be adding proper docs for this soon.

Great ! It's working now with v1.2.0-beta.2.

While this is ok for setting up migrations for existing instance, it could be handy to have a single commande to apply both sql and metadata migrations.

Anyway, thanks for your work !

@EmrysMyrddin glad to here it's working now. I'm closing this issue 馃檪

Was this page helpful?
0 / 5 - 0 ratings