Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<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">
<changeSet author="berrahmaach" id="correct-shunt-compensator-formulas-switchedOnQAtNominalV">
<comment>Correct switchedOnQAtNominalV formula - replace incorrect formula with the correct one</comment>
<sql dbms="postgresql">
UPDATE spreadsheet_column
SET formula = '(maxQAtNominalV / maximumSectionCount) * sectionCount'
WHERE column_id = 'switchedOnQAtNominalV'
AND formula = 'maxQAtNominalV / maximumSectionCount';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we still have the previous changlog that converts switchedOnQAtNominalV into maxQAtNominalV / maximumSectionCount :)

Copy link
Contributor

Choose a reason for hiding this comment

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

yes!

</sql>
</changeSet>

<changeSet author="berrahmaach" id="correct-shunt-compensator-formulas-switchedOnSusceptance">
<comment>Correct switchedOnSusceptance formula - replace incorrect formula with the correct one</comment>
<sql dbms="postgresql">
UPDATE spreadsheet_column
SET formula = '(maxSusceptance / maximumSectionCount) * sectionCount'
WHERE column_id = 'switchedOnSusceptance'
AND formula = 'maxSusceptance / maximumSectionCount';
</sql>
</changeSet>

<changeSet author="berrahmaach" id="update-section-count-columns-precision">
<comment>Update precision to 0 for maximumSectionCount and sectionCount columns where precision is null</comment>
<sql dbms="postgresql">
UPDATE spreadsheet_column
SET precision = 0
WHERE column_id IN ('maximumSectionCount', 'sectionCount')
AND precision IS NULL;
</sql>
</changeSet>
</databaseChangeLog>
3 changes: 3 additions & 0 deletions src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ databaseChangeLog:
- include:
file: changesets/changelog_20250606T123216Z.xml
relativeToChangelogFile: true
- include:
file: changesets/changelog_20250616T090000Z.xml
relativeToChangelogFile: true
8 changes: 4 additions & 4 deletions src/main/resources/default-spreadsheet-config-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1313,15 +1313,15 @@
{
"name": "Maximum number of sections",
"type": "NUMBER",
"precision": null,
"precision": 0,
"formula": "maximumSectionCount",
"dependencies": null,
"id": "maximumSectionCount"
},
{
"name": "Current number of sections",
"type": "NUMBER",
"precision": null,
"precision": 0,
"formula": "sectionCount",
"dependencies": null,
"id": "sectionCount"
Expand All @@ -1338,7 +1338,7 @@
"name": "Switch-on Q at nominal voltage",
"type": "NUMBER",
"precision": 1,
"formula": "maxQAtNominalV / maximumSectionCount",
"formula": "(maxQAtNominalV / maximumSectionCount) * sectionCount",
"dependencies": null,
"id": "switchedOnQAtNominalV"
},
Expand All @@ -1354,7 +1354,7 @@
"name": "Switch-on susceptance",
"type": "NUMBER",
"precision": 5,
"formula": "maxSusceptance / maximumSectionCount",
"formula": "(maxSusceptance / maximumSectionCount) * sectionCount",
"dependencies": null,
"id": "switchedOnSusceptance"
},
Expand Down