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

Automate updates of main cover and main wastewater node #97

Merged
merged 6 commits into from
Jan 19, 2024

Conversation

cymed
Copy link
Contributor

@cymed cymed commented Jan 19, 2024

As discussed in TEKSI Feedbacks session from 19.01.2024. Entry point for interlis import in plugin.

Edit concerning the final PR: calling the functions with obj_id=NULL and _all=false, i.e. tww_app.wastewater_structure_update_fk_main_cover(NULL), only the entries where the main cover currently is NULL are updated.

cymed added a commit to cymed/TEKSI-wastewater that referenced this pull request Jan 19, 2024
Function is now included in teksi#97
@cymed cymed marked this pull request as draft January 19, 2024 09:50
@cymed cymed marked this pull request as ready for review January 19, 2024 09:51
LEFT JOIN tww_od.structure_part sp ON sp.fk_wastewater_structure = ws.obj_id
LEFT JOIN tww_od.cover co ON sp.obj_id = co.obj_id
LEFT JOIN tww_od.channel ch ON ch.obj_id = ws.obj_id
WHERE (_all OR ws.obj_id = _obj_id ) AND ch.obj_id IS NULL AND ws.fk_main_cover IS NULL
Copy link
Contributor

Choose a reason for hiding this comment

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

my question here is regarding ws.fk_main_cover IS NULL
if we use _all, don't we expect to run on all?

or can we assume, that we will never need to fix this data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggestion: 3 input options:

_obj_id: as is
_all : as is
_all_nulls: for automated imports

Copy link
Contributor

Choose a reason for hiding this comment

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

I would keep 2, but combine them

_obj_id = XXX => do XXX (don't care about NULL=
_obj_id NULL and _all is false => do only NULLs
_all is TRUE => do all

Copy link
Contributor

Choose a reason for hiding this comment

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

so calling without args would be the automated import

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Do we want this setup for all the symbology functions with the arguments _obj_id and _all?

cymed and others added 3 commits January 19, 2024 11:05
@3nids 3nids merged commit 10b752b into teksi:main Jan 19, 2024
4 checks passed
3nids added a commit that referenced this pull request Jan 23, 2024
* update main cover if new cover is added and fk is null

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove "case"

* use lowercase for alias

* code layout

* remove function from PR

Function is now included in #97

* Update function name

* Add default NULL on _obj_id and documentation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Denis Rouzaud <[email protected]>
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.

2 participants