Skip to content

Commit 91cf2d1

Browse files
committed
add keeplocalcopy field to the customcert table
1 parent 9a11c53 commit 91cf2d1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

db/install.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<FIELD NAME="language" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false" COMMENT="Force certificate to render with specified langauge"/>
2323
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
2424
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
25+
<FIELD NAME="keeplocalcopy" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Force certificate to keep a local copy of the PDF"/>
2526
</FIELDS>
2627
<KEYS>
2728
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for customcert"/>

db/upgrade.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,17 @@ function xmldb_customcert_upgrade($oldversion) {
200200
upgrade_mod_savepoint(true, 2022041903, 'customcert'); // Replace with the actual version number.
201201
}
202202

203+
if ($oldversion < 2023101000) {
204+
$table = new xmldb_table('customcert');
205+
$field = new xmldb_field('keeplocalcopy', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'language');
206+
207+
// Conditionally launch add field.
208+
if (!$dbman->field_exists($table, $field)) {
209+
$dbman->add_field($table, $field);
210+
}
211+
212+
upgrade_mod_savepoint(true, 2023101000, 'customcert'); // Replace with the actual version number.
213+
}
214+
203215
return true;
204216
}

0 commit comments

Comments
 (0)