Files
autocrm/database/migrations
Vasyka f484167b51 fix(migration): case-insensitive dedupe on units backfill + use insertOrIgnore
MariaDB default collation is case-insensitive on VARCHAR unique indexes,
so 'L' and 'l' clash on units_company_id_code_unique. When a tenant had
'L' in parts.unit (uppercase) and the migration seeds 'l' (lowercase),
the extras loop tried to re-insert 'L' and errored out — blocking all
subsequent migrations (including the new injector_protocols tables).

Fix: lowercase the comparison + switch the extras insert to
insertOrIgnore so a residual race is a no-op.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-26 11:39:34 +00:00
..