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 authored Jul 27, 2023
1 parent d61a707 commit 8669702
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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
6 changes: 3 additions & 3 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_ADMIN_SECRET=''
// export HASURA_ADMIN_SECRET='VeufARxUrX7q8V8skiMr'
// export PG_ADMIN_USER='hasura'
// export PG_ADMIN_PASSWORD=''
// export PG_ADMIN_PASSWORD='4wiqzvuFW3imkWMCRzmD'
// 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 8669702

Please sign in to comment.