Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing remaining database triggers #2230

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lampajr
Copy link
Member

@lampajr lampajr commented Jan 8, 2025

Fixes Issue

Fixes #2228
Fixes #2231

Changes proposed

Moved the logic to update run_schemas and dataset_schemas into Horreum logic and as a consequence I removed the following entities:

Triggers:

  • ds_after_insert
  • rs_after_run_untrash
  • rs_after_run_update
  • before_schema_update

Functions:

  • ds_after_dataset_insert_func
  • rs_after_run_update
  • before_schema_update_func

I kept the procedure update_run_schemas in the db as it is always called by the Horreum directly.

Additionally with commit 714223f I removed the remaining triggers on Run table:

  • after_run_update_non_data, moved logic into Horreum
  • delete_run_validations, we are not even allowing Runs to be deleted so no need to keep that

With commit d18fcc7 I also removed all triggers associated to the label table:

  • lv_before_update
  • lv_after_update
  • recalc_labels

And related functions. Moreover I also deleted the label_recalc_queue table as no longer used.

Preconditions

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.

As part of this refactoring I removed table
view_recalc_queue and:

Triggers
- dsv_after_delete
- dsv_after_update
- recalc_dataset_view
- dsv_after_insert

Functions:
- dsv_after_vc_delete_func
- dsv_after_vc_update_func
- recalc_dataset_view
- dsv_after_lv_insert_func

Signed-off-by: Andrea Lamparelli <[email protected]>
@lampajr lampajr changed the title Run triggers Removing run_ and dataset_ schemas triggers Jan 8, 2025
Propagate run description and access changes to
the corresponding datasets without db triggers.

Removed after_run_update_non_data trigger and
related function.

Removed delete_run_validations as we are not
even exposing Run deletion.

Signed-off-by: Andrea Lamparelli <[email protected]>
Remove no longer used label triggers including
the label_recalc_queue table.

Signed-off-by: Andrea Lamparelli <[email protected]>
@lampajr lampajr changed the title Removing run_ and dataset_ schemas triggers Removing remaining database triggers Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove triggers on label table Move run_/dataset_ schemas updates into Horreum logic
1 participant