diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/HydrantIndispoTemporaire.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/HydrantIndispoTemporaire.java index 2f0d02a54..0f7c032a9 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/HydrantIndispoTemporaire.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/HydrantIndispoTemporaire.java @@ -30,7 +30,10 @@ public class HydrantIndispoTemporaire { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "indispo_temp_seq") - @SequenceGenerator(name = "indispo_temp_seq", sequenceName = "hydrant_indispo_temporaire_id_seq") + @SequenceGenerator( + allocationSize = 1, + name = "indispo_temp_seq", + sequenceName = "hydrant_indispo_temporaire_id_seq") @Column(name = "id") private Long id; diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeHydrantIndispoStatut.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeHydrantIndispoStatut.java index da51f8cbc..fba9e6fa7 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeHydrantIndispoStatut.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeHydrantIndispoStatut.java @@ -24,6 +24,7 @@ public class TypeHydrantIndispoStatut { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_hydrant_indispo_statut_seq") @SequenceGenerator( + allocationSize = 1, name = "type_hydrant_indispo_statut_seq", sequenceName = "type_hydrant_indispo_statut_id_seq") @Column(name = "id") diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAcces.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAcces.java index a34457aad..38708a80e 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAcces.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAcces.java @@ -19,7 +19,10 @@ public class TypeOldebAcces { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_oldeb_acces_seq") - @SequenceGenerator(name = "type_oldeb_acces_seq", sequenceName = "type_oldeb_acces_id_seq") + @SequenceGenerator( + allocationSize = 1, + name = "type_oldeb_acces_seq", + sequenceName = "type_oldeb_acces_id_seq") @Column(name = "id") private Long id; diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAction.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAction.java index 680fb3941..7ed78ce62 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAction.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAction.java @@ -19,7 +19,10 @@ public class TypeOldebAction { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_oldeb_action_seq") - @SequenceGenerator(name = "type_oldeb_action_seq", sequenceName = "type_oldeb_action_id_seq") + @SequenceGenerator( + allocationSize = 1, + name = "type_oldeb_action_seq", + sequenceName = "type_oldeb_action_id_seq") @Column(name = "id") private Long id; diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAnomalie.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAnomalie.java index f1220ce9f..d4b0b4ff1 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAnomalie.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAnomalie.java @@ -21,7 +21,10 @@ public class TypeOldebAnomalie { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_oldeb_anomalie_seq") - @SequenceGenerator(name = "type_oldeb_anomalie_seq", sequenceName = "type_oldeb_anomalie_id_seq") + @SequenceGenerator( + allocationSize = 1, + name = "type_oldeb_anomalie_seq", + sequenceName = "type_oldeb_anomalie_id_seq") @Column(name = "id") private Long id; diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAvis.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAvis.java index 73d4b8095..6dd8609e5 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAvis.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebAvis.java @@ -19,7 +19,10 @@ public class TypeOldebAvis implements ITypeReferenceNomActif { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_oldeb_avis_seq") - @SequenceGenerator(name = "type_oldeb_avis_seq", sequenceName = "type_oldeb_avis_id_seq") + @SequenceGenerator( + allocationSize = 1, + name = "type_oldeb_avis_seq", + sequenceName = "type_oldeb_avis_id_seq") @Column(name = "id") private Long id; diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCaracteristique.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCaracteristique.java index cf7a41711..7aa3bd5dc 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCaracteristique.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCaracteristique.java @@ -22,6 +22,7 @@ public class TypeOldebCaracteristique { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_oldeb_caracteristique_seq") @SequenceGenerator( + allocationSize = 1, name = "type_oldeb_caracteristique_seq", sequenceName = "type_oldeb_caracteristique_id_seq") @Column(name = "id") diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieAnomalie.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieAnomalie.java index 3608874ab..ec66590fb 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieAnomalie.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieAnomalie.java @@ -22,6 +22,7 @@ public class TypeOldebCategorieAnomalie { strategy = GenerationType.SEQUENCE, generator = "type_oldeb_categorie_anomalie_seq") @SequenceGenerator( + allocationSize = 1, name = "type_oldeb_categorie_anomalie_seq", sequenceName = "type_oldeb_categorie_anomalie_id_seq") @Column(name = "id") diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieCaracteristique.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieCaracteristique.java index 2c958b3cb..05e0ef820 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieCaracteristique.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebCategorieCaracteristique.java @@ -25,6 +25,7 @@ public class TypeOldebCategorieCaracteristique { strategy = GenerationType.SEQUENCE, generator = "type_oldeb_categorie_caracteristique_seq") @SequenceGenerator( + allocationSize = 1, name = "type_oldeb_categorie_caracteristique_seq", sequenceName = "type_oldeb_categorie_caracteristique_id_seq") @Column(name = "id") diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebDebroussaillement.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebDebroussaillement.java index 5cdd8a7f4..bc26f707e 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebDebroussaillement.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebDebroussaillement.java @@ -24,6 +24,7 @@ public class TypeOldebDebroussaillement { strategy = GenerationType.SEQUENCE, generator = "type_oldeb_debroussaillement_seq") @SequenceGenerator( + allocationSize = 1, name = "type_oldeb_debroussaillement_seq", sequenceName = "type_oldeb_debroussaillement_id_seq") @Column(name = "id") diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebResidence.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebResidence.java index da6303a59..75574c070 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebResidence.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebResidence.java @@ -20,6 +20,7 @@ public class TypeOldebResidence { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_oldeb_residence_seq") @SequenceGenerator( + allocationSize = 1, name = "type_oldeb_residence_seq", sequenceName = "type_oldeb_residence_id_seq") @Column(name = "id") diff --git a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebZoneUrbanisme.java b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebZoneUrbanisme.java index b7ab4082b..a136ff5ec 100644 --- a/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebZoneUrbanisme.java +++ b/remocra/src/main/java/fr/sdis83/remocra/domain/remocra/TypeOldebZoneUrbanisme.java @@ -20,6 +20,7 @@ public class TypeOldebZoneUrbanisme { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "type_oldeb_zone_urbanisme_seq") @SequenceGenerator( + allocationSize = 1, name = "type_oldeb_zone_urbanisme_seq", sequenceName = "type_oldeb_zone_urbanisme_id_seq") @Column(name = "id") diff --git a/server/sdis-remocra/home/postgres/remocra_db/patches/196/196.sql b/server/sdis-remocra/home/postgres/remocra_db/patches/196/196.sql new file mode 100644 index 000000000..003489dce --- /dev/null +++ b/server/sdis-remocra/home/postgres/remocra_db/patches/196/196.sql @@ -0,0 +1,45 @@ +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 := 196; + description_patch := 'Remet toutes les séquences gérées par hibernate à jour'; + + -- 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 +SELECT setval('hydrant_indispo_temporaire_id_seq', (SELECT MAX(id) FROM remocra.hydrant_indispo_temporaire)+1); +SELECT setval('type_hydrant_indispo_statut_id_seq', (SELECT MAX(id) FROM remocra.type_hydrant_indispo_statut)+1); +SELECT setval('type_oldeb_acces_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_acces)+1); +SELECT setval('type_oldeb_action_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_action)+1); +SELECT setval('type_oldeb_anomalie_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_anomalie)+1); +SELECT setval('type_oldeb_avis_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_avis)+1); +SELECT setval('type_oldeb_caracteristique_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_caracteristique)+1); +SELECT setval('type_oldeb_categorie_anomalie_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_categorie_anomalie)+1); +SELECT setval('type_oldeb_categorie_caracteristique_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_categorie_caracteristique)+1); +SELECT setval('type_oldeb_debroussaillement_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_debroussaillement)+1); +SELECT setval('type_oldeb_residence_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_residence)+1); +SELECT setval('type_oldeb_zone_urbanisme_id_seq', (SELECT MAX(id) FROM remocra.type_oldeb_zone_urbanisme)+1); +-- Contenu réel du patch fin +-------------------------------------------------- +COMMIT; \ No newline at end of file