mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merged from MOODLE_14_STABLE: Indexes and version bump for attendance
This commit is contained in:
parent
ce64ebf9b7
commit
f75d0a479c
5 changed files with 29 additions and 7 deletions
|
@ -40,11 +40,15 @@ function attendance_upgrade($oldversion) {
|
|||
|
||||
}
|
||||
|
||||
if ($oldversion < 2004111200) {
|
||||
execute_sql('ALTER TABLE prefix_attendance DROP INDEX course;',false);
|
||||
execute_sql('ALTER TABLE prefix_attendance_roll DROP INDEX dayid;',false);
|
||||
execute_sql('ALTER TABLE prefix_attendance_roll DROP INDEX userid;',false);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
modify_database('','ALTER TABLE prefix_attendance ADD INDEX course (course);');
|
||||
modify_database('','ALTER TABLE prefix_attendance_roll ADD INDEX dayid (dayid);');
|
||||
modify_database('','ALTER TABLE prefix_attendance_roll ADD INDEX userid (userid);');
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ CREATE TABLE prefix_attendance (
|
|||
dynsection tinyint(1) NOT NULL default '0',
|
||||
edited tinyint(1) NOT NULL default '0',
|
||||
autoattend tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (id)
|
||||
PRIMARY KEY (id),
|
||||
KEY `course` (`course`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
#
|
||||
|
@ -28,7 +29,9 @@ CREATE TABLE prefix_attendance_roll (
|
|||
hour tinyint(1) unsigned NOT NULL default '0',
|
||||
status int(11) NOT NULL default '0',
|
||||
notes varchar(64) NOT NULL default '',
|
||||
PRIMARY KEY (id)
|
||||
PRIMARY KEY (id),
|
||||
KEY `dayid` (`dayid`),
|
||||
KEY `userid` (`userid`)
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
|
||||
INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
|
||||
|
|
|
@ -30,6 +30,16 @@ function attendance_upgrade($oldversion) {
|
|||
|
||||
|
||||
|
||||
if ($oldversion < 2004111200) {
|
||||
execute_sql('DROP INDEX prefix_attendance_course_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_attendance_roll_dayid_idx;',false);
|
||||
execute_sql('DROP INDEX prefix_attendance_roll_userid_idx;',false);
|
||||
|
||||
modify_database('','CREATE INDEX prefix_attendance_course_idx ON prefix_attendance (course);');
|
||||
modify_database('','CREATE INDEX prefix_attendance_roll_dayid_idx ON prefix_attendance_roll (dayid);');
|
||||
modify_database('','CREATE INDEX prefix_attendance_roll_userid_idx ON prefix_attendance_roll (userid);');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ CREATE TABLE prefix_attendance (
|
|||
PRIMARY KEY(id)
|
||||
);
|
||||
|
||||
CREATE INDEX prefix_attendance_course_idx ON prefix_attendance (course);
|
||||
|
||||
#
|
||||
# Table structure for table `prefix_attendance_roll`
|
||||
#
|
||||
|
@ -31,6 +33,9 @@ CREATE TABLE prefix_attendance_roll (
|
|||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE INDEX prefix_attendance_roll_dayid_idx ON prefix_attendance_roll (dayid);
|
||||
CREATE INDEX prefix_attendance_roll_userid_idx ON prefix_attendance_roll (userid);
|
||||
|
||||
INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
|
||||
INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
|
||||
INSERT INTO prefix_log_display VALUES ('attendance', 'viewall', 'attendance', 'name');
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2004060400; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->version = 2004111200; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->requires = 2004052505; // Requires this Moodle version
|
||||
$module->cron = 3600; // Period for cron to check this module (secs)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue