mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 00:05:49 +02:00
Use GREATEST(counter, MAX(issue_number)) + 1 when incrementing the company issue counter. This self-corrects any desync between the companies.issue_counter column and the actual max issues.issue_number, preventing duplicate key violations on the identifier unique index. Fixes #2705