Skip to content

Migration two renammings for modification by filter and by formula #577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?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>
<update tableName="assignment">
<column name="edited_field" value="MAX_SUSCEPTANCE"/>
<where>edited_field='MAXIMUM_SUSCEPTANCE'</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>
<update tableName="formula">
<column name="edited_field" value="MAX_SUSCEPTANCE"/>
<where>edited_field='MAXIMUM_SUSCEPTANCE'</where>
</update>
<update tableName="formula">
<column name="equipment_field1" value="MAX_SUSCEPTANCE"/>
<where>equipment_field1='MAXIMUM_SUSCEPTANCE'</where>
</update>
<update tableName="formula">
<column name="equipment_field2" value="MAX_SUSCEPTANCE"/>
<where>equipment_field2='MAXIMUM_SUSCEPTANCE'</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 @@ -94,13 +94,13 @@ protected List<AssignmentInfos<?>> getAssignmentInfos() {
.build();

DoubleAssignmentInfos assignmentInfos3 = DoubleAssignmentInfos.builder()
.editedField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name())
.editedField(ShuntCompensatorField.MAX_SUSCEPTANCE.name())
.value(5.)
.filters(List.of(filter4))
.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 @@ -98,16 +98,16 @@ protected List<FormulaInfos> getFormulaInfos() {
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SECTION_COUNT.name()).build(),
ReferenceFieldOrValue.builder().value(2.).build());

FormulaInfos formulaInfos3 = getFormulaInfo(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name(),
FormulaInfos formulaInfos3 = getFormulaInfo(ShuntCompensatorField.MAX_SUSCEPTANCE.name(),
List.of(filter4),
Operator.ADDITION,
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name()).build(),
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAX_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
Loading