diff --git a/src/main/resources/db/changelog/changesets/changelog_20250616T090000Z.xml b/src/main/resources/db/changelog/changesets/changelog_20250616T090000Z.xml new file mode 100644 index 0000000..af708e9 --- /dev/null +++ b/src/main/resources/db/changelog/changesets/changelog_20250616T090000Z.xml @@ -0,0 +1,32 @@ + + + + Correct switchedOnQAtNominalV formula - replace incorrect formula with the correct one + + UPDATE spreadsheet_column + SET formula = '(maxQAtNominalV / maximumSectionCount) * sectionCount' + WHERE column_id = 'switchedOnQAtNominalV' + AND formula = 'maxQAtNominalV / maximumSectionCount'; + + + + + Correct switchedOnSusceptance formula - replace incorrect formula with the correct one + + UPDATE spreadsheet_column + SET formula = '(maxSusceptance / maximumSectionCount) * sectionCount' + WHERE column_id = 'switchedOnSusceptance' + AND formula = 'maxSusceptance / maximumSectionCount'; + + + + + Update precision to 0 for maximumSectionCount and sectionCount columns where precision is null + + UPDATE spreadsheet_column + SET precision = 0 + WHERE column_id IN ('maximumSectionCount', 'sectionCount') + AND precision IS NULL; + + + diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index f98db5e..176617f 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -56,3 +56,6 @@ databaseChangeLog: - include: file: changesets/changelog_20250606T123216Z.xml relativeToChangelogFile: true + - include: + file: changesets/changelog_20250616T090000Z.xml + relativeToChangelogFile: true diff --git a/src/main/resources/default-spreadsheet-config-collection.json b/src/main/resources/default-spreadsheet-config-collection.json index ecc7b8b..7654212 100644 --- a/src/main/resources/default-spreadsheet-config-collection.json +++ b/src/main/resources/default-spreadsheet-config-collection.json @@ -1313,7 +1313,7 @@ { "name": "Maximum number of sections", "type": "NUMBER", - "precision": null, + "precision": 0, "formula": "maximumSectionCount", "dependencies": null, "id": "maximumSectionCount" @@ -1321,7 +1321,7 @@ { "name": "Current number of sections", "type": "NUMBER", - "precision": null, + "precision": 0, "formula": "sectionCount", "dependencies": null, "id": "sectionCount" @@ -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" }, @@ -1354,7 +1354,7 @@ "name": "Switch-on susceptance", "type": "NUMBER", "precision": 5, - "formula": "maxSusceptance / maximumSectionCount", + "formula": "(maxSusceptance / maximumSectionCount) * sectionCount", "dependencies": null, "id": "switchedOnSusceptance" },