Skip to content

Commit

Permalink
fix: Use correct schema name in is provisioned check (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley committed Jul 27, 2023
1 parent d61a707 commit 5493b04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions indexer-js-queue-handler/provisioner.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ export default class Provisioner {
}

async isUserApiProvisioned(accountId, functionName) {
const databaseName = this.replaceSpecialChars(accountId);
const schemaName = this.replaceSpecialChars(functionName);
const sanitizedAccountId = this.replaceSpecialChars(accountId);
const sanitizedFunctionName = this.replaceSpecialChars(functionName);

const databaseName = sanitizedAccountId;
const schemaName = `${sanitizedAccountId}_${sanitizedFunctionName}`;

const sourceExists = await this.hasuraClient.doesSourceExist(databaseName);
if (!sourceExists) {
Expand Down
4 changes: 2 additions & 2 deletions indexer-js-queue-handler/scripts/migrate-schema-to-db.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// export HASURA_ENDPOINT='https://queryapi-hasura-graphql-vcqilefdcq-ew.a.run.app'
// export HASURA_ENDPOINT=''
// export HASURA_ADMIN_SECRET=''
// export PG_ADMIN_USER='hasura'
// export PG_ADMIN_PASSWORD=''
// export PG_ADMIN_DATABASE='postgres'
// export PG_HOST=''
// export PG_HOST='104.199.4.194'
// export PG_PORT=5432
// export CHAIN_ID='mainnet'
// export ENV='dev'
Expand Down

0 comments on commit 5493b04

Please sign in to comment.