Commit 3f277c1
(fix): CI — emit INSERT IGNORE when skipDuplicates is set in SQL::createDocuments
The MariaDB/MySQL/Postgres/SQLite adapters' shared createDocuments() always
called $builder->insert(), ignoring the skipDuplicates flag. When
Mirror::createDocuments forwarded a batch to destination under
skipDuplicates (to backfill rows where source had INSERT IGNORE them as
no-ops but destination still lacked them), destination crashed with
PDOException 1062 Duplicate entry.
Route through the query builder's insertOrIgnore() when skipDuplicates is
true — it compiles to INSERT IGNORE (MySQL/MariaDB), INSERT OR IGNORE
(SQLite), and INSERT ... ON CONFLICT DO NOTHING (Postgres).
Fixes MirrorTest::testCreateDocumentsSkipDuplicatesBackfillsDestination.1 parent 6f2fc7f commit 3f277c1
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
| 631 | + | |
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| |||
0 commit comments