Skip to content

Commit

Permalink
Migration MAXIMUM_Q_AT_NOMINAL_VOLTAGE to MAX_Q_AT_NOMINAL_V for modi…
Browse files Browse the repository at this point in the history
…fication by filter and by formula

Signed-off-by: Thang PHAM <[email protected]>
  • Loading branch information
thangqp committed Dec 16, 2024
1 parent 1da3840 commit 73bb37e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="phamquy (generated)" id="1734359257002-1">
<update tableName="assignment">
<column name="edited_field" value="MAX_Q_AT_NOMINAL_V"/>
<where>edited_field='MAXIMUM_Q_AT_NOMINAL_VOLTAGE'</where>
</update>
</changeSet>
<changeSet author="phamquy (generated)" id="1734359257002-2">
<update tableName="formula">
<column name="edited_field" value="MAX_Q_AT_NOMINAL_V"/>
<where>edited_field='MAXIMUM_Q_AT_NOMINAL_VOLTAGE'</where>
</update>
<update tableName="formula">
<column name="equipment_field1" value="MAX_Q_AT_NOMINAL_V"/>
<where>equipment_field1='MAXIMUM_Q_AT_NOMINAL_VOLTAGE'</where>
</update>
<update tableName="formula">
<column name="equipment_field2" value="MAX_Q_AT_NOMINAL_V"/>
<where>equipment_field2='MAXIMUM_Q_AT_NOMINAL_VOLTAGE'</where>
</update>
</changeSet>
</databaseChangeLog>
5 changes: 4 additions & 1 deletion src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,7 @@ databaseChangeLog:
file: changesets/changelog_20241015T130742Z.xml
- include:
relativeToChangelogFile: true
file: changesets/changelog_20241206T123930Z.xml
file: changesets/changelog_20241206T123930Z.xml
- include:
relativeToChangelogFile: true
file: changesets/changelog_20241216T142706Z.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected List<AssignmentInfos<?>> getAssignmentInfos() {
.build();

DoubleAssignmentInfos assignmentInfos4 = DoubleAssignmentInfos.builder()
.editedField(ShuntCompensatorField.MAXIMUM_Q_AT_NOMINAL_VOLTAGE.name())
.editedField(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name())
.value(10.)
.filters(List.of(filter5))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ protected List<FormulaInfos> getFormulaInfos() {
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name()).build(),
ReferenceFieldOrValue.builder().value(5.).build());

FormulaInfos formulaInfos4 = getFormulaInfo(ShuntCompensatorField.MAXIMUM_Q_AT_NOMINAL_VOLTAGE.name(),
FormulaInfos formulaInfos4 = getFormulaInfo(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name(),
List.of(filter5),
Operator.DIVISION,
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_Q_AT_NOMINAL_VOLTAGE.name()).build(),
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name()).build(),
ReferenceFieldOrValue.builder().value(2.).build());

return List.of(formulaInfos1, formulaInfos2, formulaInfos3, formulaInfos4);
Expand Down

0 comments on commit 73bb37e

Please sign in to comment.