Rewrite existing transcriptions when updating
The CreateTranscriptions
and UpdateTranscriptions
APIs share the same code and use the following workflow to bulk insert:
- Compute all zones and transcriptions to create, skipping any already existing zones/transcriptions
- With
UpdateTranscriptions
, remove all existing transcriptions - Bulk insert zones and transcriptions using PostgreSQL's
COPY FROM
.
This workflow works fine with CreateTranscriptions
, but in the case of UpdateTranscriptions
, existing transcriptions are ignored, then deleted; therefore, they are not inserted again. Running UpdateTranscriptions
twice with the same payload will cause all transcriptions to be removed.
Edited by Erwan Rouchet