Skip to content

Commit

Permalink
fix(questionregex,questionrange): remove bad FK rows
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed May 18, 2022
1 parent f1dc088 commit c162429
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion install/upgrade_to_2.13.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,15 @@ public function questionParameterUnicity() {
WHERE dr.plugin_formcreator_questions_id = j.question_id AND dr.id <> j.qrid
");


$tables = [
'glpi_plugin_formcreator_questionranges',
'glpi_plugin_formcreator_questionregexes',
];

foreach ($tables as $table) {
$DB->delete($table, [
'plugin_formcreator_questions_id' => '0'
]);
$this->migration->addKey($table, ['plugin_formcreator_questions_id', 'fieldname'], 'unicity', 'UNIQUE');
}
}
Expand Down

0 comments on commit c162429

Please sign in to comment.