How to track all tables/relationships faster for existing db #7655
-
I am just starting so I apologize if this is ignorant. Clicking "Track All" under "Untracked tables or views" in the UI takes a very long time (30 minutes) to run on a local test version of our production schema. Further, clicking "Track All" for "Untracked Foreign-key and relationships" takes just as long but doesn't seem to set up any fk relationships, showing one error popup for one relationship in the list:
Is there a faster way to initialize the hasura metadata for this database? Troubleshooting proves quite difficult. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Assuming this is a known database & metadata, you can export the metadata from an existing project and import it into the new one. The above is however not the recommended way if you need to version control your metadata. This is all assuming you have an existing hasura project where the tables and relations are already tracked |
Beta Was this translation helpful? Give feedback.
-
OK, gotcha. So this just needs to take a while the first time but then you can just import the metadata after that. For example when spinning up a new instance in a CI/CD system I assume this import reasonably fast from a file. |
Beta Was this translation helpful? Give feedback.
-
makes perfect sense. thank you |
Beta Was this translation helpful? Give feedback.
Assuming this is a known database & metadata, you can export the metadata from an existing project and import it into the new one.
The easiest way is accessed by clicking on the cog icon to the top right of the console
You can then click on export/import metadata depending on whether this is a the existing or new project.
The above is however not the recommended way if you need to version control your metadata.
For that, you would need to use the hasura cli to export or apply metadata. Check out the docs here
This is all assuming you have an existing hasura project where the tables and relations are already tracked