I found this:
My questions are in comments on blogspot. This is it:
Why in PHPMYADMIN in table mdl_mymodule the new fields are not available but in XMLDB Editor are available?!
I found this:
My questions are in comments on blogspot. This is it:
Why in PHPMYADMIN in table mdl_mymodule the new fields are not available but in XMLDB Editor are available?!
upgrade.php not upgrade db tables ;( I don't know why... I fix it editing db/install.xml paste into code from xmldb editor (XMLDB > MyModule > View edited) and reinstall my newmodule. Thanks for helping
Unfortunetely. If I updated plugin version in upgrade.php and version.php in Notification is everything allright but mysql not create new fields. In XMLDB new fields are.
Just to check you copied the code from the XMLDB editor into upgrade.php before running the upgrade - not install.xml, which it builds automatically?
So in upgrade.php you have something like:
if ($result && $oldversion < newversionumber) {
$table = new xmldb_table('tablename');
$field = new xmldb_field('newfieldname', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, 'settings');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_plugin_savepoint(true, newversionnumber, 'plugin', 'subplugin');//copy this from the XMLDB editor
}
?
J
Yes, I did it but not working :P My fix works fine