From e0a57935adf5b3bc49ae1f6f6922f653c0caa245 Mon Sep 17 00:00:00 2001
From: sebastien <dupuy@datakode.fr>
Date: Fri, 27 Oct 2023 15:55:59 +0200
Subject: [PATCH] Correctif de la migration pour inserer dans les shelflifes

---
 migrations/Version20230320143746.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/migrations/Version20230320143746.php b/migrations/Version20230320143746.php
index fe4ec41e7..0745e9ad8 100644
--- a/migrations/Version20230320143746.php
+++ b/migrations/Version20230320143746.php
@@ -43,6 +43,9 @@ final class Version20230320143746 extends AbstractMigration
             if ($treatment['delay_other_delay']) {
                 $this->addSql('INSERT INTO registry_treatment_shelf_life(id, treatment_id, name, duration, ultimate_fate ) VALUES (?,?,?,?,?)', [Uuid::uuid4(), $treatment['id'], 'Délai de conservation', $treatment['delay_comment'], $treatment['ultimate_fate']]);
             }
+            if (!$treatment['delay_number'] && !$treatment['delay_other_delay'] && $treatment['ultimate_fate']) {
+                $this->addSql('INSERT INTO registry_treatment_shelf_life(id, treatment_id, name, duration, ultimate_fate ) VALUES (?,?,?,?,?)', [Uuid::uuid4(), $treatment['id'], 'Délai de conservation', 'Non renseigné', $treatment['ultimate_fate']]);
+            }
         }
         $this->addSql('ALTER TABLE registry_treatment DROP delay_number, DROP delay_period, DROP delay_other_delay, DROP delay_comment, DROP ultimate_fate, CHANGE collectivity_id collectivity_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', CHANGE creator_id creator_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', CHANGE cloned_from_id cloned_from_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', CHANGE service_id service_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', CHANGE software software VARCHAR(255) DEFAULT NULL, CHANGE legal_basis legal_basis JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\', CHANGE manager manager VARCHAR(255) DEFAULT NULL, CHANGE security_access_control_comment security_access_control_comment VARCHAR(255) DEFAULT NULL, CHANGE security_tracability_comment security_tracability_comment VARCHAR(255) DEFAULT NULL, CHANGE security_saving_comment security_saving_comment VARCHAR(255) DEFAULT NULL, CHANGE security_update_comment security_update_comment VARCHAR(255) DEFAULT NULL, CHANGE security_other_comment security_other_comment VARCHAR(255) DEFAULT NULL, CHANGE template_identifier template_identifier INT DEFAULT NULL, CHANGE data_origin data_origin VARCHAR(255) DEFAULT NULL, CHANGE author author VARCHAR(255) DEFAULT NULL, CHANGE concerned_people_particular_comment concerned_people_particular_comment VARCHAR(255) DEFAULT NULL, CHANGE concerned_people_user_comment concerned_people_user_comment VARCHAR(255) DEFAULT NULL, CHANGE concerned_people_agent_comment concerned_people_agent_comment VARCHAR(255) DEFAULT NULL, CHANGE concerned_people_elected_comment concerned_people_elected_comment VARCHAR(255) DEFAULT NULL, CHANGE concerned_people_company_comment concerned_people_company_comment VARCHAR(255) DEFAULT NULL, CHANGE concerned_people_partner_comment concerned_people_partner_comment VARCHAR(255) DEFAULT NULL, CHANGE concerned_people_other_comment concerned_people_other_comment VARCHAR(255) DEFAULT NULL, CHANGE collecting_method collecting_method JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\', CHANGE estimated_concerned_people estimated_concerned_people INT DEFAULT NULL, CHANGE coordonnees_responsable_traitement coordonnees_responsable_traitement VARCHAR(255) DEFAULT NULL, CHANGE legal_mentions legal_mentions TINYINT(1) DEFAULT \'0\', CHANGE consent_request consent_request TINYINT(1) DEFAULT \'0\', CHANGE concerned_people_usager_comment concerned_people_usager_comment VARCHAR(255) DEFAULT NULL');
     }
-- 
GitLab