Use DELETE instead of TRUNCATE to avoid requiring table ownership.
Wrap in DO block for better error handling and logging.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The _ProductConstructeurs table was created with wrong column order:
- Before: A=product, B=constructeur
- After: A=constructeur, B=product (alphabetical order expected by Prisma)
This caused Prisma to fail loading constructeurs relations, resulting in empty constructeurs arrays in API responses.
Changes:
- Added migration to swap A/B columns and recreate foreign keys
- Added debug logs in products.service.ts and constructeur-link.util.ts
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- extend Prisma schema with products, product constructs and link tables\n- introduce product service, DTOs and includes with constructeur support\n- integrate product selections across model type skeletons, composants, pièces and machines\n- validate product requirements when building machine skeletons and payloads