Skip to content

Commit acbffb7

Browse files
Fix non null columns in liquibase (#98)
1 parent 5c3590b commit acbffb7

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

src/main/java/org/gridsuite/shortcircuit/server/entities/ShortCircuitParametersEntity.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public ShortCircuitParametersEntity(@NonNull final ShortCircuitParametersEntity
5656
private UUID id;
5757

5858
@Builder.Default
59-
@Column(name = "withLimitViolations", columnDefinition = "boolean default true")
59+
@Column(name = "withLimitViolations", nullable = false, columnDefinition = "boolean default true")
6060
private boolean withLimitViolations = true;
6161

6262
@Builder.Default
63-
@Column(name = "withVoltageResult", columnDefinition = "boolean default false")
63+
@Column(name = "withVoltageResult", nullable = false, columnDefinition = "boolean default false")
6464
private boolean withVoltageResult = false;
6565

6666
@Builder.Default
67-
@Column(name = "withFeederResult", columnDefinition = "boolean default true")
67+
@Column(name = "withFeederResult", nullable = false, columnDefinition = "boolean default true")
6868
private boolean withFeederResult = true;
6969

7070
@Builder.Default
@@ -73,7 +73,7 @@ public ShortCircuitParametersEntity(@NonNull final ShortCircuitParametersEntity
7373
private StudyType studyType = StudyType.TRANSIENT;
7474

7575
@Builder.Default
76-
@Column(name = "minVoltageDropProportionalThreshold", columnDefinition = "double precision default 20.0")
76+
@Column(name = "minVoltageDropProportionalThreshold", nullable = false, columnDefinition = "double precision default 20.0")
7777
private double minVoltageDropProportionalThreshold = 20.0;
7878

7979
@Builder.Default
@@ -82,19 +82,19 @@ public ShortCircuitParametersEntity(@NonNull final ShortCircuitParametersEntity
8282
private ShortCircuitPredefinedConfiguration predefinedParameters = ShortCircuitPredefinedConfiguration.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP;
8383

8484
@Builder.Default
85-
@Column(name = "withLoads", columnDefinition = "boolean default false")
85+
@Column(name = "withLoads", nullable = false, columnDefinition = "boolean default false")
8686
private boolean withLoads = false;
8787

8888
@Builder.Default
89-
@Column(name = "withShuntCompensators", columnDefinition = "boolean default false")
89+
@Column(name = "withShuntCompensators", nullable = false, columnDefinition = "boolean default false")
9090
private boolean withShuntCompensators = false;
9191

9292
@Builder.Default
93-
@Column(name = "withVscConverterStations", columnDefinition = "boolean default true")
93+
@Column(name = "withVscConverterStations", nullable = false, columnDefinition = "boolean default true")
9494
private boolean withVscConverterStations = true;
9595

9696
@Builder.Default
97-
@Column(name = "withNeutralPosition", columnDefinition = "boolean default true")
97+
@Column(name = "withNeutralPosition", nullable = false, columnDefinition = "boolean default true")
9898
private boolean withNeutralPosition = true;
9999

100100
@Builder.Default
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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" xmlns:pro="http://www.liquibase.org/xml/ns/pro"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
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">
6+
<changeSet author="chuinetri (generated)" id="1719214154012-1">
7+
<addNotNullConstraint columnDataType="boolean" columnName="with_feeder_result" tableName="shortcircuit_parameters" validate="true"/>
8+
<addNotNullConstraint columnDataType="boolean" columnName="with_limit_violations" tableName="shortcircuit_parameters" validate="true"/>
9+
<addNotNullConstraint columnDataType="boolean" columnName="with_loads" tableName="shortcircuit_parameters" validate="true"/>
10+
<addNotNullConstraint columnDataType="boolean" columnName="with_neutral_position" tableName="shortcircuit_parameters" validate="true"/>
11+
<addNotNullConstraint columnDataType="boolean" columnName="with_shunt_compensators" tableName="shortcircuit_parameters" validate="true"/>
12+
<addNotNullConstraint columnDataType="boolean" columnName="with_voltage_result" tableName="shortcircuit_parameters" validate="true"/>
13+
<addNotNullConstraint columnDataType="boolean" columnName="with_vsc_converter_stations" tableName="shortcircuit_parameters" validate="true"/>
14+
</changeSet>
15+
</databaseChangeLog>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ databaseChangeLog:
3838
- include:
3939
file: changesets/changelog_20240515T001122Z.xml
4040
relativeToChangelogFile: true
41+
- include:
42+
file: changesets/changelog_20240624T072900Z.xml
43+
relativeToChangelogFile: true

0 commit comments

Comments
 (0)