Add field exist check for alignment field

This commit is contained in:
Alistair Spark 2021-11-17 12:50:35 +00:00 committed by Mark Nelson
parent 311e243ca5
commit 12d8122c14

View file

@ -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.
}