mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Added an index on courses for the category
This commit is contained in:
parent
8d86ba60a0
commit
3052e775c8
4 changed files with 12 additions and 1 deletions
|
@ -494,6 +494,10 @@ function main_upgrade($oldversion=0) {
|
||||||
table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
|
table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($oldversion < 2003082101) {
|
||||||
|
execute_sql(" ALTER TABLE `{$CFG->prefix}course` ADD INDEX category (category) ");
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,8 @@ CREATE TABLE `prefix_course` (
|
||||||
`visible` int(10) unsigned NOT NULL default '1',
|
`visible` int(10) unsigned NOT NULL default '1',
|
||||||
`timecreated` int(10) unsigned NOT NULL default '0',
|
`timecreated` int(10) unsigned NOT NULL default '0',
|
||||||
`timemodified` int(10) unsigned NOT NULL default '0',
|
`timemodified` int(10) unsigned NOT NULL default '0',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `category` (`category`)
|
||||||
) TYPE=MyISAM;
|
) TYPE=MyISAM;
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -238,6 +238,10 @@ function main_upgrade($oldversion=0) {
|
||||||
table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
|
table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($oldversion < 2003082101) {
|
||||||
|
execute_sql(" CREATE INDEX {$CFG->prefix}course_category_idx ON {$CFG->prefix}course (category) ");
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,6 +30,8 @@ CREATE TABLE prefix_course (
|
||||||
timemodified integer NOT NULL default '0'
|
timemodified integer NOT NULL default '0'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE INDEX prefix_course_category_idx ON prefix_course (category);
|
||||||
|
|
||||||
CREATE TABLE prefix_course_categories (
|
CREATE TABLE prefix_course_categories (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
name varchar(255) NOT NULL default ''
|
name varchar(255) NOT NULL default ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue