Skip to content

Commit 37ecff5

Browse files
authored
Update formulas for switchedOnQAtNominalV and switchedOnSusceptance in spreadsheet configuration (#57)
1 parent ff2d4e1 commit 37ecff5

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
3+
<changeSet author="berrahmaach" id="update-shunt-compensator-formulas-switchedOnQAtNominalV">
4+
<comment>Update switchedOnQAtNominalV formula to use maxQAtNominalV / maximumSectionCount only if it hasn't been modified</comment>
5+
<sql dbms="postgresql">
6+
UPDATE spreadsheet_column
7+
SET formula = 'maxQAtNominalV / maximumSectionCount'
8+
WHERE column_id = 'switchedOnQAtNominalV'
9+
AND formula = 'switchedOnQAtNominalV';
10+
</sql>
11+
</changeSet>
12+
13+
<changeSet author="berrahmaach" id="update-shunt-compensator-formulas-switchedOnSusceptance">
14+
<comment>Update switchedOnSusceptance formula to use maxSusceptance / maximumSectionCount only if it hasn't been modified</comment>
15+
<sql dbms="postgresql">
16+
UPDATE spreadsheet_column
17+
SET formula = 'maxSusceptance / maximumSectionCount'
18+
WHERE column_id = 'switchedOnSusceptance'
19+
AND formula = 'switchedOnSusceptance';
20+
</sql>
21+
</changeSet>
22+
</databaseChangeLog>

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ databaseChangeLog:
5050
- include:
5151
file: changesets/changelog_20250604T144112Z.xml
5252
relativeToChangelogFile: true
53+
- include:
54+
file: changesets/changelog_20250612T140000Z.xml
55+
relativeToChangelogFile: true

src/main/resources/default-spreadsheet-config-collection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@
13381338
"name": "Switch-on Q at nominal voltage",
13391339
"type": "NUMBER",
13401340
"precision": 1,
1341-
"formula": "switchedOnQAtNominalV",
1341+
"formula": "maxQAtNominalV / maximumSectionCount",
13421342
"dependencies": null,
13431343
"id": "switchedOnQAtNominalV"
13441344
},
@@ -1354,7 +1354,7 @@
13541354
"name": "Switch-on susceptance",
13551355
"type": "NUMBER",
13561356
"precision": 5,
1357-
"formula": "switchedOnSusceptance",
1357+
"formula": "maxSusceptance / maximumSectionCount",
13581358
"dependencies": null,
13591359
"id": "switchedOnSusceptance"
13601360
},

0 commit comments

Comments
 (0)