RED-8712: Remove manual redactions on non existing pages #382

Merged
dominique.eiflaender1 merged 1 commits from RED-8712-4.1 into master 2024-03-11 11:08:35 +01:00
2 changed files with 9 additions and 0 deletions

View File

@ -187,3 +187,5 @@ databaseChangeLog:
file: db/changelog/tenant/sql/205-add-dossier-dictionaries-as-entity.sql
- include:
file: db/changelog/tenant/121-set-dictionary-entry-type-for-dictionary-adds-where-null.yaml
- include:
file: db/changelog/tenant/sql/206-remove-manual-redactions-on-non-existing-pages.sql

View File

@ -0,0 +1,7 @@
Delete
from redaction.manual_redaction
where concat(annotation_id, file_id) in (SELECT concat(manual_redaction_entry_entity_annotation_id, id)
from redaction.file file
JOIN redaction.manual_redaction_entry_entity_positions pos
ON file.id = pos.manual_redaction_entry_entity_file_id
where file.number_of_pages < pos.page);