Skip to content

Commit de703fa

Browse files
Add liquibase update
1 parent 4ed16fb commit de703fa

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import java.util.UUID;
1515

1616
@Repository
17-
public interface ShortCircuitParametersRepository extends JpaRepository<ShortCircuitParametersEntity, UUID> {
17+
public interface ParametersRepository extends JpaRepository<ShortCircuitParametersEntity, UUID> {
1818
default ShortCircuitParametersEntity getByIdOrDefault(@NonNull final UUID id) {
1919
return findById(id).orElseGet(() -> this.save(new ShortCircuitParametersEntity()));
2020
}

src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.gridsuite.shortcircuit.server.entities.ShortCircuitAnalysisResultEntity;
2020
import org.gridsuite.shortcircuit.server.entities.ShortCircuitParametersEntity;
2121
import org.gridsuite.shortcircuit.server.repositories.ShortCircuitAnalysisResultRepository;
22-
import org.gridsuite.shortcircuit.server.repositories.ShortCircuitParametersRepository;
22+
import org.gridsuite.shortcircuit.server.repositories.ParametersRepository;
2323
import org.jetbrains.annotations.Nullable;
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@ public class ShortCircuitService {
4646
@NonNull private final NotificationService notificationService;
4747
@NonNull private final UuidGeneratorService uuidGeneratorService;
4848
@NonNull private final ShortCircuitAnalysisResultRepository resultRepository;
49-
@NonNull private final ShortCircuitParametersRepository parametersRepository;
49+
@NonNull private final ParametersRepository parametersRepository;
5050
@NonNull private final ObjectMapper objectMapper;
5151

5252
public UUID runAndSaveResult(@NonNull final UUID networkUuid, final String variantId, final String receiver,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
3+
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
4+
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
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">
7+
<changeSet author="chuinetri (generated)" id="1703808925709-1">
8+
<createTable tableName="short_circuit_parameters">
9+
<column name="id" type="UUID">
10+
<constraints nullable="false" primaryKey="true" primaryKeyName="short_circuit_parametersPK"/>
11+
</column>
12+
<column defaultValue="&quot;NOMINAL&quot;" name="initial_voltage_profile_mode" type="VARCHAR(15)"/>
13+
<column defaultValueNumeric="20.0" name="min_voltage_drop_proportional_threshold" type="DOUBLE PRECISION"/>
14+
<column defaultValue="&quot;ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP&quot;" name="predefined_parameters" type="VARCHAR(35)"/>
15+
<column defaultValue="&quot;TRANSIENT&quot;" name="study_type" type="VARCHAR(15)"/>
16+
<column defaultValueBoolean="true" name="with_feeder_result" type="BOOLEAN"/>
17+
<column defaultValueBoolean="false" name="with_fortescue_result" type="BOOLEAN"/>
18+
<column defaultValueBoolean="true" name="with_limit_violations" type="BOOLEAN"/>
19+
<column defaultValueBoolean="false" name="with_loads" type="BOOLEAN"/>
20+
<column defaultValueBoolean="true" name="with_neutral_position" type="BOOLEAN"/>
21+
<column defaultValueBoolean="false" name="with_shunt_compensators" type="BOOLEAN"/>
22+
<column defaultValueBoolean="false" name="with_voltage_result" type="BOOLEAN"/>
23+
<column defaultValueBoolean="true" name="with_vsc_converter_stations" type="BOOLEAN"/>
24+
</createTable>
25+
</changeSet>
26+
</databaseChangeLog>

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ databaseChangeLog:
3030
- include:
3131
file: changesets/changelog_20231123T101034Z.xml
3232
relativeToChangelogFile: true
33+
- include:
34+
file: changesets/changelog_20231228T211507Z.xml
35+
relativeToChangelogFile: true

0 commit comments

Comments
 (0)