Commit 0d43b66
committed
Wrap createDocuments in skipDuplicates for idempotent re-imports
CSV / JSON / appwrite-to-appwrite imports that re-run on the same
batch (e.g. user re-uploads the same file, or a worker retries a
failed chunk) currently throw DuplicateException and abort the whole
batch. Wrap the row-buffer flush in the new skipDuplicates() scope
guard so duplicate-by-id rows are silently no-op'd at the adapter
layer (INSERT IGNORE / ON CONFLICT DO NOTHING / $setOnInsert), letting
the rest of the batch proceed.
The existing skipRelationshipsExistCheck() wrapper is preserved
(FK-target guard); skipDuplicates composes around it.
Feature-branch note: depends on utopia-php/database's skipDuplicates()
scope guard from PR utopia-php/database#852. composer.json is
temporarily pinned to dev-csv-import-upsert-v2 with a 5.99.0 alias so
composer can resolve the 5.* constraint transitively. Must be reset
to the proper release version (^5.X.Y) once PR #852 merges and
utopia-php/database ships.1 parent 7a86aea commit 0d43b66
File tree
3 files changed
+143
-175
lines changed- src/Migration/Destinations
3 files changed
+143
-175
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments