From 4dadea8a1298d26ac1d1cbbab7b094613092faec Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 18 Aug 2022 13:28:55 +0200 Subject: [PATCH] fix(install): avoid alter table fail some columns are null and making them not null requires to remove null values --- install/upgrade_to_2.13.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/install/upgrade_to_2.13.php b/install/upgrade_to_2.13.php index 87cccc39b..48247a44d 100644 --- a/install/upgrade_to_2.13.php +++ b/install/upgrade_to_2.13.php @@ -138,6 +138,36 @@ public function fixTables(): void { ['destination_entity_value' => '0'], ['destination_entity_value' => null] ); + $DB->update( + $table, + ['sla_question_tto' => '0'], + ['sla_question_tto' => null] + ); + $DB->update( + $table, + ['sla_question_ttr' => '0'], + ['sla_question_ttr' => null] + ); + $DB->update( + $table, + ['ola_question_tto' => '0'], + ['ola_question_tto' => null] + ); + $DB->update( + $table, + ['ola_question_ttr' => '0'], + ['ola_question_ttr' => null] + ); + $DB->update( + $table, + ['sla_rule' => '0'], + ['sla_rule' => null] + ); + $DB->update( + $table, + ['ola_rule' => '0'], + ['ola_rule' => null] + ); $this->migration->changeField($table, 'validation_followup', 'validation_followup', 'bool', ['after' => 'urgency_question', 'value' => '1']); $this->migration->changeField($table, 'destination_entity', 'destination_entity', 'integer', ['after' => 'validation_followup', 'value' => '1']); $this->migration->changeField($table, 'destination_entity_value', 'destination_entity_value', $unsignedIntType, ['after' => 'destination_entity', 'default' => '1']);