From 057748c47aa6dd77e5c5e523acd417e3bce4070e Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 17 Nov 2026 14:49:41 +0100 Subject: [PATCH] fix(db): set no deferred references once the move refused a value Nothing is inserted after the first refused value, so the self-references held back had no rows to land on, and the move failed on them instead of listing the values (MOVE-006). --- server/src/db/engine/postgres/sqlite-move/move.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/db/engine/postgres/sqlite-move/move.ts b/server/src/db/engine/postgres/sqlite-move/move.ts index 8cf836049..2bf752f63 100644 --- a/server/src/db/engine/postgres/sqlite-move/move.ts +++ b/server/src/db/engine/postgres/sqlite-move/move.ts @@ -187,7 +187,8 @@ async function copyAll( copied.push(result); }; await inOrder(plan.specs, copyOne(source)); - await inOrder(copied, (table) => applyDeferred(trx, table)); + // Once a value was refused nothing more is inserted, so there are no rows to point at each other. + if (refused === 0) await inOrder(copied, (table) => applyDeferred(trx, table)); const sequences: CopiedSequence[] = [...plan.sequences]; const pluginTables = new Map();