Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

1 - Shorter coding. I like short codes. Martin D had made longer before.

2 - Create indexes sliently.
  • Loading branch information...
commit a83254c3e1748f5964c601ebb3291356ae344428 1 parent c58f510
ethem authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 enrol/authorize/db/mysql.php
View
9 enrol/authorize/db/mysql.php
@@ -7,10 +7,7 @@ function authorize_upgrade($oldversion=0) {
$result = true;
- if ($oldversion == 0) {
- $result = modify_database("$CFG->dirroot/enrol/authorize/db/mysql.sql");
- return $result; // SQL file contains all upgrades.
- } else if (!in_array($CFG->prefix . 'enrol_authorize', $db->MetaTables('TABLES'))) {
+ if ($oldversion == 0 || !in_array($CFG->prefix . 'enrol_authorize', $db->MetaTables('TABLES'))) {
$result = modify_database("$CFG->dirroot/enrol/authorize/db/mysql.sql");
return $result; // SQL file contains all upgrades.
}
@@ -21,8 +18,8 @@ function authorize_upgrade($oldversion=0) {
table_column('enrol_authorize', 'courseid', 'courseid', 'integer', '10', 'unsigned', '0', 'not null');
table_column('enrol_authorize', 'userid', 'userid', 'integer', '10', 'unsigned', '0', 'not null');
// Add some indexes for speed.
- execute_sql(" ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX courseid(courseid) ");
- execute_sql(" ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX userid(userid) ");
+ execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX courseid(courseid)", false);
+ execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX userid(userid)", false);
}
if ($oldversion && $oldversion < 2005071602) {
Please sign in to comment.
Something went wrong with that request. Please try again.