From a90eee0f757335431b140c2b7c81f2fc76d1ef31 Mon Sep 17 00:00:00 2001 From: Fred Zhang Date: Fri, 13 Dec 2024 10:04:00 -0800 Subject: [PATCH] ensureServiceIsConnectedToCloudSql only need to call backend when schemaValidation==NONE (#8049) --- src/dataconnect/schemaMigration.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dataconnect/schemaMigration.ts b/src/dataconnect/schemaMigration.ts index 1741a35bd5a..c6c05fb76fe 100644 --- a/src/dataconnect/schemaMigration.ts +++ b/src/dataconnect/schemaMigration.ts @@ -543,6 +543,7 @@ async function ensureServiceIsConnectedToCloudSql( { postgresql: { database: databaseId, + schemaValidation: "NONE", cloudSql: { instance: instanceId, }, @@ -566,7 +567,8 @@ async function ensureServiceIsConnectedToCloudSql( `Switching connected Postgres database from ${postgresql?.database} to ${databaseId}`, ); } - if (!postgresql || postgresql.schemaValidation === "STRICT") { + if (!postgresql || postgresql.schemaValidation !== "NONE") { + // Skip provisioning connectvity if it is already connected. return; } postgresql.schemaValidation = "STRICT";