Local Development and Staging Workflows with Hasura v2.0 #6746
-
Hi! We are considering using hasura in production but I don't understand what the worflow is for moving from local development to staging/production with v2.0. The issue is that when I apply metadata to another environment it overrides my DB connection settings with the one from which the migration is applied. So for example if I apply staging metadata to the prod env, it replaces the prod db connection string with the staging one. Applying migrations across environments is unclear with v2.0 as well. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey guys, are you using environment variables for the db connection? |
Beta Was this translation helpful? Give feedback.
-
A little late, but I had the same issue, so posting in case of others running into it as well: Just make sure your - name: default
kind: postgres
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
isolation_level: read-committed
use_prepared_statements: false
tables: "!include default/tables/tables.yaml" if |
Beta Was this translation helpful? Give feedback.
A little late, but I had the same issue, so posting in case of others running into it as well:
You need to set the db connection within the console to
environment variable
instead ofdatabase url
, then when youhasura metadata export
there is no hardcoded db connection, from then on you simply supply a different connection to every instance through the env vars (in my case direct in https://cloud.hasura.io/project/< id >/env-vars).Just make sure your
hasura/metadata/databases/databases.yaml
look something along the lines of this: