This is an old revision of the document!
This pages documents the MantisBT schema definition script (admin/schema.php), and explains how to modify it.
The schema is defined as a numbered list of updates (aka upgrade steps), stored as an array. Each step consists of two elements:
The integrity of the schema relies on strict ordering of this array.
Release markers are placed right AFTER the last schema step that is included in the corresponding release:
$g_upgrade = array( 'AddColumnSQL', array( db_get_table( 'bug_file' ), " user_id I UNSIGNED NOTNULL DEFAULT '0' " ) ); # Release marker: 1.2.0rc1 $g_upgrade = array( 'DropColumnSQL', array( db_get_table( 'custom_field' ), 'advanced' ) );
In the above example, steps up to 173 are part of 1.2.0rc1, while 174 and onwards are included in 1.2.0rc2.
This section documents available upgrade operations:
UpdateFunction: local function to perform arbitrary changes
null: no-op upgrade step
Local function to add data to a table.
UpdateFunction allows arbitrary PHP code to be executed via a function, which must be defined in install_helper_functions_api.php with
No-op upgrade step.
This is used to skip the step while maintaining the upgrade sequence, e.g. when an operation becomes obsolete or doesn't apply for specific cases.