Skip to content

Commit 0d43b66

Browse files
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

3 files changed

+143
-175
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"type": "library",
55
"keywords": ["php", "framework", "upf", "utopia", "migration"],
66
"license": "MIT",
7-
"minimum-stability": "stable",
7+
"minimum-stability": "dev",
8+
"prefer-stable": true,
89
"autoload": {
910
"psr-4": {
1011
"Utopia\\Migration\\": "src/Migration"
@@ -26,7 +27,7 @@
2627
"ext-curl": "*",
2728
"ext-openssl": "*",
2829
"appwrite/appwrite": "19.*",
29-
"utopia-php/database": "5.*",
30+
"utopia-php/database": "dev-csv-import-upsert-v2 as 5.99.0",
3031
"utopia-php/storage": "1.0.*",
3132
"utopia-php/dsn": "0.2.*",
3233
"halaxa/json-machine": "^1.2"

0 commit comments

Comments
 (0)