From ddd23cfe02c23e93969b82b8c5aaa2ea7b00b436 Mon Sep 17 00:00:00 2001 From: Ayoub LABIDI Date: Thu, 7 Aug 2025 11:40:32 +0200 Subject: [PATCH 1/2] Add 150kV limit reductions Signed-off-by: Ayoub LABIDI --- src/main/resources/config/application.yaml | 4 +++ .../changesets/changelog_20250807T090300Z.xml | 35 +++++++++++++++++++ .../db/changelog/db.changelog-master.yaml | 3 ++ 3 files changed, 42 insertions(+) create mode 100644 src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml index 44e6d8b2..ffdc9313 100644 --- a/src/main/resources/config/application.yaml +++ b/src/main/resources/config/application.yaml @@ -70,6 +70,9 @@ security-analysis: highBound: 75 - nominalV: 90 lowBound: 75 + highBound: 120 + - nominalV: 150 + lowBound: 120 highBound: 180 - nominalV: 225 lowBound: 180 @@ -103,5 +106,6 @@ security-analysis: - [ 1, 1, 1, 1, 1, 1 ] - [ 1, 1, 1, 1, 1, 1 ] - [ 1, 1, 1, 1, 1, 1 ] + - [ 1, 1, 1, 1, 1, 1 ] - [ 1, 1, 0.95, 0.95, 0.9, 0.9 ] - [ 1, 1, 0.95, 0.95, 0.9, 0.9 ] diff --git a/src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml b/src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml new file mode 100644 index 00000000..957b0208 --- /dev/null +++ b/src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml @@ -0,0 +1,35 @@ + + + + + UPDATE limit_reduction_entity + SET index = index + 1 + WHERE index >= 4; + + + + + + INSERT INTO limit_reduction_entity (id, security_analysis_parameters_id, index) + SELECT gen_random_uuid(), id, 4 + FROM security_analysis_parameters; + + + + + + INSERT INTO limit_reduction_entity_reductions (limit_reduction_entity_id, reductions, index) + SELECT lre.id, v.reduction, v.idx + FROM limit_reduction_entity lre + CROSS JOIN (VALUES + (0, 1), + (1, 1), + (2, 1), + (3, 1), + (4, 1), + (5, 1) + ) AS v(idx, reduction) + WHERE lre.index = 4; + + + diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 7279e0d3..7d5d82d7 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -42,3 +42,6 @@ databaseChangeLog: - include: file: changesets/changelog_20250207T161145Z.xml relativeToChangelogFile: true + - include: + file: changesets/changelog_20250807T090300Z.xml + relativeToChangelogFile: true From 9d8e18df2268972ccd67f46283a8aa40b499dc28 Mon Sep 17 00:00:00 2001 From: Ayoub LABIDI Date: Thu, 7 Aug 2025 11:50:44 +0200 Subject: [PATCH 2/2] Add changeSet for H2 compatibility Signed-off-by: Ayoub LABIDI --- .../changesets/changelog_20250807T090300Z.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml b/src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml index 957b0208..96ecc269 100644 --- a/src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml +++ b/src/main/resources/db/changelog/changesets/changelog_20250807T090300Z.xml @@ -8,7 +8,15 @@ - + + + INSERT INTO limit_reduction_entity (id, security_analysis_parameters_id, index) + SELECT RANDOM_UUID(), id, 4 + FROM security_analysis_parameters; + + + + INSERT INTO limit_reduction_entity (id, security_analysis_parameters_id, index) SELECT gen_random_uuid(), id, 4