Skip to content

Commit

Permalink
Add field exist check for alignment field
Browse files Browse the repository at this point in the history
  • Loading branch information
aspark21 authored and mdjnelson committed Jan 10, 2022
1 parent 311e243 commit 12d8122
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ function xmldb_customcert_upgrade($oldversion) {
$table = new xmldb_table('customcert_elements');
$field = new xmldb_field('alignment', XMLDB_TYPE_CHAR, '1', null, XMLDB_NOTNULL, null, 'L', 'refpoint');

$dbman->add_field($table, $field);
// Conditionally launch add field.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

upgrade_mod_savepoint(true, 2021051702, 'customcert'); // Replace with the actual version number.
}
Expand Down

0 comments on commit 12d8122

Please sign in to comment.