Skip to content

Conversation

ipirog
Copy link

@ipirog ipirog commented Aug 25, 2025

No description provided.

Copy link

<changeSet author="pirogigo" id="1756119288000-1">
<update tableName="voltage_init_result_entity_bus_voltages">
<column name="voltage_level_id"
valueComputed="regexp_replace(bus_id, '_[0-9]{1,2}$', '')" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is the right approach to retrieve the voltage level ID.
The proposed solution relies on string formatting, but the formatting rules may vary from one view to another (Bus_Breaker or Node_Breaker). Even if the rule is well defined, it's still possible to create a voltage level whose base name contains an underscore, which would break this approach.

Copy link
Author

@ipirog ipirog Aug 29, 2025

Choose a reason for hiding this comment

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

Only the last occurence of _X(X) is deleted in the resulting voltage_level_id, a base name containing " _ " will be correctly updated : $ – The end of a line .

@ipirog ipirog closed this Sep 1, 2025
@ipirog
Copy link
Author

ipirog commented Sep 1, 2025

The information voltage_level_id is correctly added in the resulting rows in db in new voltage initialization jobs. Not necessary to add the information on old jobs.

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