hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.19k stars 2.77k forks source link

Unable to upgrade project to config v3 #7297

Open adilamanat4 opened 3 years ago

adilamanat4 commented 3 years ago

Hi, I'm trying to set up migrations so that they can be controlled through version control. currently, I'm following this documentation https://hasura.io/docs/latest/graphql/core/migrations/migrations-setup.html. My schema doesn't have default database so, i had to upgrade to config v3. while running this command hasura scripts update-project-v3 i get

FATA[0063] {
  "path": "$",
  "error": "source with name \"default\" does not exist",
  "code": "not-exists"
} 

I'm confused about what I'm doing wrong. how can I get rid of this?

rikinsk commented 3 years ago

Hi. Could you share a little more information on your set up, like the Hasura version, etc. and what exactly you are tryin to achieve. If you are setting up migrations and the hasura project from scratch, you do not need to run the hasura scripts update-project-v3 command. The command is used to update an existing project in config v2 to the new config v3 format. Your project should already be in the v3 format if you are following the above guide

adilamanat4 commented 3 years ago

@rikinsk. I'm trying to create migrations of the existing database so, I can deploy that to other environments(dev,stage) .I currently has config v2 and cli v2.0.0-alpha.10 installed.

rikinsk commented 3 years ago

@adilamanat4 Got it. Can you confirm if are using a 2.0 Hasura version? If yes can you check with what name you have your database connected (you can check this from the console).
If you havent been using migrations yet and are setting them up fresh, I believe the above guide should just work for you. You can create a new project directory which will be with config v3 and then not have to worry about the config v3 upgrade.