Commit ee1812da authored by Nigel McNie's avatar Nigel McNie
Browse files

Install a bunch of stuff required for the template migration, like blocktypes and their categories.

Also changed a couple of columns in view_artefact to be nullable while the migration is running. Tried this with XMLDB, it ate my face.
parent b390c841
......@@ -320,10 +320,30 @@ function xmldb_core_upgrade($oldversion=0) {
$key->setAttributes(XMLDB_KEY_FOREIGN, array('block'), 'block_instance', array('id'));
add_key($table, $key);
// These fields will be dropped after the template migration. However,
// given that the table needs to be used by block instances being
// created, make the fields nullable during that time.
// Note - XMLDB - you are a whore. Hate, Nigel
execute_sql('ALTER TABLE {view_artefact} ALTER ctime DROP NOT NULL');
execute_sql('ALTER TABLE {view_artefact} ALTER format DROP NOT NULL');
// Install all the blocktypes and their categories now, as they'll be
// needed for the template migration
install_blocktype_categories();
foreach(array('textbox', 'file/image', 'file/filedownload', 'blog/blogpost', 'blog/blog') as $blocktype) {
$data = check_upgrades("blocktype.$blocktype");
upgrade_plugin($data);
}
// install the view column widths
install_view_column_widths();
// Run the template migration
require_once(get_config('docroot') . 'lib/db/templatemigration.php');
upgrade_template_migration();
change_field_notnull(new XMLDBTAble('view_artefact'), new XMLDBTable('block'));
// TODO - enable this again
//execute_sql('ALTER TABLE {view_artefact} ALTER block SET NOT NULL');
$table = new XMLDBTable('view_artefact');
$field = new XMLDBField('oldblock');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment