diff --git a/indexer-js-queue-handler/provisioner.js b/indexer-js-queue-handler/provisioner.js index df75e6a6f..78704bcf6 100644 --- a/indexer-js-queue-handler/provisioner.js +++ b/indexer-js-queue-handler/provisioner.js @@ -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) { diff --git a/indexer-js-queue-handler/scripts/migrate-schema-to-db.js b/indexer-js-queue-handler/scripts/migrate-schema-to-db.js index de5415155..b4b6a787e 100644 --- a/indexer-js-queue-handler/scripts/migrate-schema-to-db.js +++ b/indexer-js-queue-handler/scripts/migrate-schema-to-db.js @@ -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'