RED-8712: Remove manual redactions on non existing pages #381
@ -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
|
||||
|
||||
@ -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);
|
||||
Loading…
x
Reference in New Issue
Block a user