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

harmonize trigger enabling/disabling #381

Merged
merged 69 commits into from
Sep 4, 2024

Conversation

cymed
Copy link
Contributor

@cymed cymed commented Aug 15, 2024

General

  • Fix a bug
  • Add a feature
  • Maintenance / sustainability
  • Add Documentation

Describe your changes

We need a way to enable/disable last_modification triggers from the plugin, see #368.

This PR creates the corresponding DB functions and calls them before importing.

Also, it moves symbology trigger checks out of the app folder, as they are created in sys

Screenshots

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.
  • CI Tests are green
  • The documentation is up to date with the proposed change.
  • My work is ready for review

Checklist before merge

  • All required reviews have been performed
  • Comments are resolved
  • Documentation is ready

Also moving symbology triggers checks out of app, as they are created in sys
@cymed cymed self-assigned this Aug 15, 2024
@cymed cymed added the datamodel Concerns the datamodel label Aug 15, 2024
@cymed cymed requested a review from sjib August 15, 2024 09:22
@cymed cymed closed this Aug 16, 2024
@cymed cymed reopened this Aug 16, 2024
@ponceta ponceta added fix Fixing something not working enhancement New feature or request and removed fix Fixing something not working labels Aug 19, 2024
@cymed cymed changed the title add function to enable/disable last_modification_triggers harmonize trigger enabling/disabling Aug 27, 2024
@ponceta ponceta added fix Fixing something not working review Waiting for review labels Aug 27, 2024
@cymed cymed changed the title harmonize trigger enabling/disabling [WIP] harmonize trigger enabling/disabling Aug 27, 2024
@cymed cymed marked this pull request as draft August 27, 2024 07:40
@cymed cymed removed the review Waiting for review label Aug 27, 2024
@cymed

This comment was marked as resolved.

@ponceta
Copy link
Member

ponceta commented Sep 3, 2024

This is really a great cleanup for the future, and this will clearly ease our maintenance efforts for the next years.

@ponceta ponceta closed this Sep 3, 2024
@ponceta ponceta reopened this Sep 3, 2024
@cymed cymed marked this pull request as ready for review September 3, 2024 12:21
@cymed cymed requested a review from ponceta September 3, 2024 12:21
@cymed cymed changed the title [WIP] harmonize trigger enabling/disabling harmonize trigger enabling/disabling Sep 3, 2024
@ponceta
Copy link
Member

ponceta commented Sep 3, 2024

image

I'll run some test and then we will be able to merge this! Thank you a lot!

@cymed cymed mentioned this pull request Sep 3, 2024
Prefixes are stored in tww_sys.oid_prefixes.
Copy link
Member

@ponceta ponceta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great and works fine! Thank you @cymed

@ponceta
Copy link
Member

ponceta commented Sep 3, 2024

@sjib please have a look at this and tell us if you're OK, since we moved some of the working logic to the app schema, this could require some adaptation in your datamodel generation scripts.

@ponceta
Copy link
Member

ponceta commented Sep 3, 2024

@ponceta when this is merged, replicate this logic to TDH for consistency.

@sjib
Copy link
Contributor

sjib commented Sep 3, 2024

I think I have to take out these lines in the datamodel sql scripts:

ALTER TABLE tww_od.organisation ALTER COLUMN obj_id SET DEFAULT tww_sys.generate_oid('tww_od','organisation');

and the trigger statements


CREATE TRIGGER
update_last_modified_sia405cc_cable_point
BEFORE UPDATE OR INSERT ON
 tww_od.sia405cc_cable_point
FOR EACH ROW EXECUTE PROCEDURE
 tww_sys.update_last_modified();

Anything else @ponceta @cymed ?

@cymed
Copy link
Contributor Author

cymed commented Sep 3, 2024

I think I have to take out these lines in the datamodel sql scripts:

ALTER TABLE tww_od.organisation ALTER COLUMN obj_id SET DEFAULT tww_sys.generate_oid('tww_od','organisation');

and the trigger statements

CREATE TRIGGER
update_last_modified_sia405cc_cable_point
BEFORE UPDATE OR INSERT ON
 tww_od.sia405cc_cable_point
FOR EACH ROW EXECUTE PROCEDURE
 tww_sys.update_last_modified();

Anything else @ponceta @cymed ?

This is all on your side

@cymed
Copy link
Contributor Author

cymed commented Sep 3, 2024

@ponceta good to merge?

@cymed cymed mentioned this pull request Sep 3, 2024
@ponceta ponceta merged commit 2780dae into teksi:main Sep 4, 2024
10 checks passed
cymed added a commit to wapaAdmin/tww2ag6496 that referenced this pull request Sep 27, 2024
- load extensions after creating functions, as oid functions now are inside the app schema
- alter function names
@cymed cymed deleted the last-modification-switch branch October 4, 2024 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datamodel Concerns the datamodel enhancement New feature or request fix Fixing something not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants