# Take Hasura migrations from staging and apply them to prod # Usage: ./migrate.sh "" "" "" "" "" STAGING_ENDPOINT="$1" STAGING_SECRET="$2" PROD_ENDPOINT="$3" PROD_SECRET="$4" MIGRATION_NAME="$5" # Create migrations and metadata exports using staging env after changes hasura migrate create $MIGRATION_NAME --from-server --endpoint $STAGING_ENDPOINT --admin-secret $STAGING_SECRET hasura metadata export --endpoint $STAGING_ENDPOINT --admin-secret $STAGING_SECRET # Apply migrations to prod hasura migrate apply --endpoint $PROD_ENDPOINT --admin-secret $PROD_SECRET hasura metadata apply --endpoint $PROD_ENDPOINT --admin-secret $PROD_SECRET