From 84a5c0dbfc96cd820cbde7559c10b6ee6b8bf335 Mon Sep 17 00:00:00 2001 From: Tristan Chuine Date: Mon, 24 Jun 2024 09:32:19 +0200 Subject: [PATCH] Fix non null columns in liquibase --- .../entities/ShortCircuitParametersEntity.java | 16 ++++++++-------- .../changesets/changelog_20240624T072900Z.xml | 15 +++++++++++++++ .../db/changelog/db.changelog-master.yaml | 3 +++ 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/db/changelog/changesets/changelog_20240624T072900Z.xml diff --git a/src/main/java/org/gridsuite/shortcircuit/server/entities/ShortCircuitParametersEntity.java b/src/main/java/org/gridsuite/shortcircuit/server/entities/ShortCircuitParametersEntity.java index 3926d3c9..1427dcd3 100644 --- a/src/main/java/org/gridsuite/shortcircuit/server/entities/ShortCircuitParametersEntity.java +++ b/src/main/java/org/gridsuite/shortcircuit/server/entities/ShortCircuitParametersEntity.java @@ -56,15 +56,15 @@ public ShortCircuitParametersEntity(@NonNull final ShortCircuitParametersEntity private UUID id; @Builder.Default - @Column(name = "withLimitViolations", columnDefinition = "boolean default true") + @Column(name = "withLimitViolations", nullable = false, columnDefinition = "boolean default true") private boolean withLimitViolations = true; @Builder.Default - @Column(name = "withVoltageResult", columnDefinition = "boolean default false") + @Column(name = "withVoltageResult", nullable = false, columnDefinition = "boolean default false") private boolean withVoltageResult = false; @Builder.Default - @Column(name = "withFeederResult", columnDefinition = "boolean default true") + @Column(name = "withFeederResult", nullable = false, columnDefinition = "boolean default true") private boolean withFeederResult = true; @Builder.Default @@ -73,7 +73,7 @@ public ShortCircuitParametersEntity(@NonNull final ShortCircuitParametersEntity private StudyType studyType = StudyType.TRANSIENT; @Builder.Default - @Column(name = "minVoltageDropProportionalThreshold", columnDefinition = "double precision default 20.0") + @Column(name = "minVoltageDropProportionalThreshold", nullable = false, columnDefinition = "double precision default 20.0") private double minVoltageDropProportionalThreshold = 20.0; @Builder.Default @@ -82,19 +82,19 @@ public ShortCircuitParametersEntity(@NonNull final ShortCircuitParametersEntity private ShortCircuitPredefinedConfiguration predefinedParameters = ShortCircuitPredefinedConfiguration.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP; @Builder.Default - @Column(name = "withLoads", columnDefinition = "boolean default false") + @Column(name = "withLoads", nullable = false, columnDefinition = "boolean default false") private boolean withLoads = false; @Builder.Default - @Column(name = "withShuntCompensators", columnDefinition = "boolean default false") + @Column(name = "withShuntCompensators", nullable = false, columnDefinition = "boolean default false") private boolean withShuntCompensators = false; @Builder.Default - @Column(name = "withVscConverterStations", columnDefinition = "boolean default true") + @Column(name = "withVscConverterStations", nullable = false, columnDefinition = "boolean default true") private boolean withVscConverterStations = true; @Builder.Default - @Column(name = "withNeutralPosition", columnDefinition = "boolean default true") + @Column(name = "withNeutralPosition", nullable = false, columnDefinition = "boolean default true") private boolean withNeutralPosition = true; @Builder.Default diff --git a/src/main/resources/db/changelog/changesets/changelog_20240624T072900Z.xml b/src/main/resources/db/changelog/changesets/changelog_20240624T072900Z.xml new file mode 100644 index 00000000..78f0ecd7 --- /dev/null +++ b/src/main/resources/db/changelog/changesets/changelog_20240624T072900Z.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 858d5f31..5c6b2495 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -38,3 +38,6 @@ databaseChangeLog: - include: file: changesets/changelog_20240515T001122Z.xml relativeToChangelogFile: true + - include: + file: changesets/changelog_20240624T072900Z.xml + relativeToChangelogFile: true