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).
This commit is contained in:
Maurice
2026-11-17 14:49:41 +01:00
parent e4457ed9eb
commit 057748c47a
@@ -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<string, CopiedTable[]>();