Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

hotfix(backend): Increase statement timeout for the double brace migration (#9245)

Zamil Majdy9d1bc25ffa7b
diff --git a/autogpt_platform/backend/migrations/20250105254106_migrate_brace_to_double_brace_string_format/migration.sql b/autogpt_platform/backend/migrations/20250105254106_migrate_brace_to_double_brace_string_format/migration.sql
index 64abb73538..2a7141b0f9 100644
--- a/autogpt_platform/backend/migrations/20250105254106_migrate_brace_to_double_brace_string_format/migration.sql
+++ b/autogpt_platform/backend/migrations/20250105254106_migrate_brace_to_double_brace_string_format/migration.sql
@@ -6,11 +6,14 @@
- AITextGeneratorBlock
- AIStructuredResponseGeneratorBlock
with a double brace format.
+ - This migration can be slow for a large updated AgentNode tables.
*/
-SET statement_timeout = '15min';
+BEGIN;
+SET LOCAL statement_timeout = '10min';
WITH to_update AS (
SELECT
+ "id",
"agentBlockId",
"constantInput"::jsonb AS j
FROM "AgentNode"
@@ -29,6 +32,7 @@ WITH to_update AS (
),
updated_rows AS (
SELECT
+ "id",
"agentBlockId",
(
j
@@ -77,4 +81,6 @@ updated_rows AS (
UPDATE "AgentNode" AS an
SET "constantInput" = ur."newConstantInput"
FROM updated_rows ur
-WHERE an."agentBlockId" = ur."agentBlockId";
+WHERE an."id" = ur."id";
+
+COMMIT;