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..380067577 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_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'