Skip to content

Commit

Permalink
Remove label triggers
Browse files Browse the repository at this point in the history
Remove no longer used label triggers including
the label_recalc_queue table.

Signed-off-by: Andrea Lamparelli <[email protected]>
  • Loading branch information
lampajr committed Jan 8, 2025
1 parent 714223f commit d18fcc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ public Integer addOrUpdateLabel(int schemaId, Label labelDTO) {
}
existing.name = label.name;

//When we clear extractors we should also delete label_values
// when we clear extractors we should also delete label_values
em.createNativeQuery(
"DELETE FROM dataset_view WHERE dataset_id IN (SELECT dataset_id FROM label_values WHERE label_id = ?1)")
.setParameter(1, existing.id).executeUpdate();
Expand Down
17 changes: 17 additions & 0 deletions horreum-backend/src/main/resources/db/changeLog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4754,4 +4754,21 @@
DROP FUNCTION delete_run_validations;
</sql>
</changeSet>
<changeSet id="129" author="lampajr">
<validCheckSum>ANY</validCheckSum>
<sql>
-- drop triggers
DROP TRIGGER IF EXISTS lv_before_update ON label;
DROP TRIGGER IF EXISTS lv_after_update ON label;
DROP TRIGGER IF EXISTS recalc_labels ON label_recalc_queue;

-- drop functions
DROP FUNCTION lv_before_label_update_func;
DROP FUNCTION lv_after_label_update_func;
DROP FUNCTION recalc_label_values;

-- drop table as no longer used
DROP TABLE label_recalc_queue;
</sql>
</changeSet>
</databaseChangeLog>

0 comments on commit d18fcc7

Please sign in to comment.