3.110.1--canary.2429.d8cc505.0 • Published 1 year ago

@knapsack/db v3.110.1--canary.2429.d8cc505.0

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
1 year ago

Starting

After you pull in new changes and want to start:

# Check the status of migrations
yarn hasura migrate status
# Apply all migrations (the `migrations/*/up.sql` files) - this will modify your PostgreSQL DB
yarn hasura migrate apply
# If this is the first migration run on a fresh db, uncomment below to apply initial seed data
#yarn seed apply
# Apply all metadata changes (all the `*.yaml` files)
yarn hasura metadata apply
# Reload the metadata
yarn hasura metadata reload
# Open up the Hasura UI
yarn start

Now make changes in the UI and you'll note files changing. Once done, if you have multiple migrations (one is made per UI action), please squash them together

# Check the status of migrations
yarn hasura migrate status
# Note the `version` of your first change, it looks like `1635992236204`
yarn hasura migrate squash --from 1635992236204
# After applying migrations and metadata update the static schema for codegen
yarn update-schema

After doing that you should only have one migration (i.e. one `up.sql` and one `down.sql`). Now just commit and push.

# Helpful Links

- https://hasura.io/docs/latest/graphql/core/migrations/migrations-setup.html
- https://hasura.io/blog/moving-from-local-development-staging-production-with-hasura/

Hasura Configuration

Current CORS Configuration (HASURA_GRAPHQL_CORS_DOMAIN Env Var):

https://*.vercel.app,https://*.onrender.com,https://*.knapsack.cloud,https://*.herokuapp.com,https://localhost,http://localhost,https://localhost:8080,https://localhost:8081,https://localhost:8082,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:9695,https://cloud.hasura.io,https://brand.homedepot.com