-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
2.6.1
-
None
-
2014020300
-
MOODLE_26_STABLE
Moodle 2.6 reports an error while upgrading:
Debug info: Invalid default value for 'id'
CREATE TABLE mdl_report_customsql_categories (
id BIGINT(10) NOT NULL DEFAULT 0 auto_increment,
name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
CONSTRAINT PRIMARY KEY (id)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 DEFAULT COLLATE = utf8_unicode_ci
Error code: ddlexecuteerror
Stack trace:
line 447 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
line 833 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 88 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
line 77 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
line 436 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
line 90 of /report/customsql/db/upgrade.php: call to database_manager->create_table()
line 510 of /lib/upgradelib.php: call to xmldb_report_customsql_upgrade()
line 1580 of /lib/upgradelib.php: call to upgrade_plugins()
line 431 of /admin/index.php: call to upgrade_noncore()
Solution:
line 82 of /report/customsql/db/upgrade.php
--$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, 0, null);
|
++$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null);
|