Skip to content

Commit

Permalink
fix(install): avoid alter table fail
Browse files Browse the repository at this point in the history
some columns are null and making them not null requires to remove null values
  • Loading branch information
btry committed Aug 18, 2022
1 parent 7e67d58 commit 4dadea8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions install/upgrade_to_2.13.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 4dadea8

Please sign in to comment.