Błąd #6466

Usuwanie korpusów

Added by Jan Kocoń over 8 years ago. Updated about 5 years ago.

Status:ZamkniętyStart date:08 Dec 2014
Priority:WysokiDue date:
Assignee:Mikołaj Szewczyk% Done:

100%

Category:-Estimated time:8.00 hours
Target version:Bundle #005

Description

Przy próbie usunięcia niektórych korpusów (np. Poligon) wyskakuje następujący błąd:

_doQuery: [Error message: Could not execute statement]
[Last executed query: DELETE FROM corpora WHERE id = 4]
[Native code: 1451]
[Native message: Cannot delete or update a parent row: a foreign key constraint fails (`inforex1`.`relations`, CONSTRAINT `relations_ibfk_11` FOREIGN KEY (`target_id`) REFERENCES `reports_annotations_optimized` (`id`) ON UPDATE CASCADE)]

History

#1 Updated by Michał Marcińczuk over 5 years ago

  • Status changed from Nowy to Przypisany
  • Assignee set to Mikołaj Szewczyk
  • Priority changed from Normalny to Wysoki
  • Target version set to Release TBD
  • Estimated time set to 8.00

Obecny sposób usuwania korpusów sprowadza się do wywołania

DELETE FROM corpora WHERE id = ?
Co się niepowiedzie m.in. dlatego, że zablokowane jest kaskadowe usuwanie relacji przy usuwaniu anotacji. Ten mechanizm chroni przed przypadkowym usunięciem anotacji, które są połączone relacjami. Usuwanie korpusu powinno odbywać się w transakcji i powinno się zacząć od usunięcia elementów powiązanych, tj.:
  • relacje,
  • atrybuty anotacji,
  • korpus.

Należy sprawdzić schemat pod kątem innych blokad przed kaskadowym usuwaniem.

#2 Updated by Michał Marcińczuk about 5 years ago

  • Target version changed from Release TBD to Bundle #003

#3 Updated by Mikołaj Szewczyk about 5 years ago

  • Target version changed from Bundle #003 to Release TBD

#4 Updated by Mikołaj Szewczyk about 5 years ago

  • Target version changed from Release TBD to Bundle #005

#5 Updated by Mikołaj Szewczyk about 5 years ago

  • % Done changed from 0 to 90

1. annotation_sets_corpora
2. activities
3. corpora_relations
4. corpora_flags
5. corpus_and_report_perspectives
6. corpus_event_groups
7. corpus_perspective_roles
8. corpus_subcorpora
9. exports -> export_errors
10. images
11. reports
12. tasks
13. users_corpus_roles
14. wccl_rules

report_id:
1. flag_status_history
2. relations (source_id, target_id)
3. relations_groups
4. reports_and_images
5. reports_annotations_attributes (annotation_id)
6. reports_annotations_lemma
7. reports_annotations_optimized
8. reports_annotations_shared_attributes
9. reports_diffs
10. reports_events
11. reports_events_slots (report_event_id)
12. reports_ext_x (metadata - DROP TABLE)
13. reports_flags
14. reports_limited_access
15. reports_users_selection
16. tasks_reports
17. tokens
18. tokens_tags_optimized (token_id) -> tokens

#6 Updated by Mikołaj Szewczyk about 5 years ago

  • % Done changed from 90 to 100

#7 Updated by Mikołaj Szewczyk about 5 years ago

  • Status changed from Przypisany to Rozwiązany

#8 Updated by Michał Marcińczuk about 5 years ago

  • Status changed from Rozwiązany to Zamknięty

Also available in: Atom PDF