Merge branch 'RED-8712-4.1' into 'master'

RED-8712: Remove manual redactions on non existing pages

Closes RED-8712

See merge request redactmanager/persistence-service!382
This commit is contained in:
Dominique Eifländer 2024-03-11 11:08:35 +01:00
commit 06970a1477
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);