Skip to content

Commit

Permalink
Ajoute un flag dans incoming.HydrantVisite pour savoir si les anomali…
Browse files Browse the repository at this point in the history
…es ont changé

Change-Id: Ic1c9b598428b0fd0889489a418be126008dddf6a
  • Loading branch information
Emilie Genton committed Oct 5, 2023
1 parent 9adb9d5 commit 64324cb
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class HydrantVisite extends TableImpl<Record> {

private static final long serialVersionUID = 550449527;
private static final long serialVersionUID = 105651387;

/**
* The reference instance of <code>incoming.hydrant_visite</code>
Expand Down Expand Up @@ -107,6 +107,11 @@ public Class<Record> getRecordType() {
*/
public final TableField<Record, String> OBSERVATIONS_HYDRANT_VISITE = createField("observations_hydrant_visite", org.jooq.impl.SQLDataType.VARCHAR, this, "");

/**
* The column <code>incoming.hydrant_visite.has_anomalie_changes</code>.
*/
public final TableField<Record, Boolean> HAS_ANOMALIE_CHANGES = createField("has_anomalie_changes", org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaulted(true), this, "");

/**
* Create a <code>incoming.hydrant_visite</code> table reference
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class HydrantVisite implements Serializable {

private static final long serialVersionUID = 1635836802;
private static final long serialVersionUID = -1850021608;

private UUID idHydrantVisite;
private Long idHydrant;
Expand All @@ -38,6 +38,7 @@ public class HydrantVisite implements Serializable {
private Double pressionHydrantVisite;
private Double pressionDynHydrantVisite;
private String observationsHydrantVisite;
private Boolean hasAnomalieChanges;

public HydrantVisite() {}

Expand All @@ -53,6 +54,7 @@ public HydrantVisite(HydrantVisite value) {
this.pressionHydrantVisite = value.pressionHydrantVisite;
this.pressionDynHydrantVisite = value.pressionDynHydrantVisite;
this.observationsHydrantVisite = value.observationsHydrantVisite;
this.hasAnomalieChanges = value.hasAnomalieChanges;
}

public HydrantVisite(
Expand All @@ -66,7 +68,8 @@ public HydrantVisite(
Integer debitHydrantVisite,
Double pressionHydrantVisite,
Double pressionDynHydrantVisite,
String observationsHydrantVisite
String observationsHydrantVisite,
Boolean hasAnomalieChanges
) {
this.idHydrantVisite = idHydrantVisite;
this.idHydrant = idHydrant;
Expand All @@ -79,6 +82,7 @@ public HydrantVisite(
this.pressionHydrantVisite = pressionHydrantVisite;
this.pressionDynHydrantVisite = pressionDynHydrantVisite;
this.observationsHydrantVisite = observationsHydrantVisite;
this.hasAnomalieChanges = hasAnomalieChanges;
}

public UUID getIdHydrantVisite() {
Expand Down Expand Up @@ -179,4 +183,13 @@ public HydrantVisite setObservationsHydrantVisite(String observationsHydrantVisi
this.observationsHydrantVisite = observationsHydrantVisite;
return this;
}

public Boolean getHasAnomalieChanges() {
return this.hasAnomalieChanges;
}

public HydrantVisite setHasAnomalieChanges(Boolean hasAnomalieChanges) {
this.hasAnomalieChanges = hasAnomalieChanges;
return this;
}
}
36 changes: 36 additions & 0 deletions server/sdis-remocra/home/postgres/remocra_db/patches/185/185.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
begin;
set statement_timeout = 0;
set client_encoding = 'UTF8';
set standard_conforming_strings = off;
set check_function_bodies = false;
set client_min_messages = warning;
set escape_string_warning = off;
set search_path = remocra, pdi, public, pg_catalog;
--------------------------------------------------
-- Versionnement du patch et vérification
--
create or replace function versionnement_dffd4df4df() returns void language plpgsql AS $body$
declare
numero_patch int;
description_patch varchar;
begin
-- Métadonnées du patch
numero_patch := 185;
description_patch := 'Ajoute une colonne dans incoming.hydrantVisite pour spécifier si les anomalies ont changées';

-- Vérification
if (select numero_patch-1 != (select max(numero) from remocra.suivi_patches)) then
raise exception 'Le numéro de patch requis n''est pas le bon. Dernier appliqué : %, en cours : %', (select max(numero) from remocra.suivi_patches), numero_patch; end if;
-- Suivi
insert into remocra.suivi_patches(numero, description) values(numero_patch, description_patch);
end $body$;
select versionnement_dffd4df4df();
drop function versionnement_dffd4df4df();
--------------------------------------------------
-- Contenu réel du patch début

ALTER TABLE incoming.hydrant_visite ADD COLUMN has_anomalie_changes boolean default false not null;

-- Contenu réel du patch fin
--------------------------------------------------
COMMIT;

0 comments on commit 64324cb

Please sign in to comment.