Updated hasura deployment notes.

This commit is contained in:
Patrick Fic
2021-05-11 16:23:49 -07:00
parent 3cadaa980a
commit 6d5e7df234
2 changed files with 33 additions and 1 deletions

View File

@@ -7,7 +7,6 @@ npx hasura console
Migrating to Staging: Migrating to Staging:
npx hasura migrate apply --endpoint https://db.imex.online/ --admin-secret 'Production-ImEXOnline!@#' npx hasura migrate apply --endpoint https://db.imex.online/ --admin-secret 'Production-ImEXOnline!@#'
npx hasura migrate apply --up 50 --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!'
npx hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!' npx hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!'
NGROK TEsting: NGROK TEsting:

View File

@@ -22,3 +22,36 @@ CREATE EXTENSION pg_trgm
Run SQL from PG Dump Run SQL from PG Dump
Import hasura metadata. Import hasura metadata.
//Done before IO BETA Release
Step 1: Nuke local migrations
Delete all the contents of your local migrations directory.
$ rm migrations/\*
Step 2: Reset the migration history on server
On the SQL tab of console, execute the following statement:
TRUNCATE hdb_catalog.schema_migrations;
Step 3: Pull the schema and metadata from server
Setup fresh migrations by taking the schema and metadata from the server:
## (available after version alpha45)
## create migration files (note that this will only export public schema from postgres)
$ hasura migrate create "init" --from-server
## note down the version
## mark the migration as applied on this server
$ hasura migrate apply --version "<version>" --skip-execution
If you are using schemas other than public, use --schema "schema_name" flag to indicate each one of them in the create command. This flag can be used multiple times. See more details about the usage in the docs.
Step 4: Verify the status
Execute the following command to verify status of migration:
$ hasura migrate status
You have brand new migrations now!
This can also be used to combine (kind of squash) all of your migration files into a single one. You're snapshotting the state of a server and adding it as a new migration.