Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(db): set no deferred references once the move refused a value

Maurice057748c47aa6
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<string, CopiedTable[]>();