added index for relation_type field for course_rel_user and session_rel_user tables - partial BT#566

skala
Cristian Fasanando 15 years ago
parent db50119163
commit f899fab03b
  1. 6
      main/install/db_main.sql
  2. 3
      main/install/migrate-db-1.8.6.2-1.8.7-pre.sql

@ -328,7 +328,7 @@ CREATE TABLE course_rel_user (
sort int default NULL,
user_course_cat int default '0',
relation_type int default 0,
PRIMARY KEY (course_code,user_id)
PRIMARY KEY (course_code,user_id,relation_type)
);
ALTER TABLE course_rel_user ADD INDEX (user_id);
@ -502,7 +502,7 @@ CREATE TABLE session_rel_user (
id_session mediumint unsigned NOT NULL default '0',
id_user mediumint unsigned NOT NULL default '0',
relation_type int default 0,
PRIMARY KEY (id_session,id_user)
PRIMARY KEY (id_session,id_user,relation_type)
);
@ -754,7 +754,7 @@ VALUES
('show_tabs', 'dashboard', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsDashboard', 1),
('use_users_timezone', 'timezones', 'radio', 'Timezones', 'true', 'UseUsersTimezoneTitle','UseUsersTimezoneComment',NULL,'Timezones', 1),
('timezone_value', 'timezones', 'select', 'Timezones', '', 'TimezoneValueTitle','TimezoneValueComment',NULL,'Timezones', 1),
('dokeos_database_version', NULL, 'textfield', NULL,'1.8.7.10741','DokeosDatabaseVersion','',NULL,NULL,0);
('dokeos_database_version', NULL, 'textfield', NULL,'1.8.7.10879','DokeosDatabaseVersion','',NULL,NULL,0);
UNLOCK TABLES;

@ -50,6 +50,9 @@ ALTER TABLE user_field_values ADD INDEX (user_id, field_id);
UPDATE settings_current SET selected_value = '1.8.7.10741' WHERE variable = 'dokeos_database_version';
ALTER TABLE course_rel_user DROP PRIMARY KEY, ADD PRIMARY KEY (course_code, user_id, relation_type);
ALTER TABLE session_rel_user DROP PRIMARY KEY, ADD PRIMARY KEY (id_session, id_user, relation_type);
-- xxSTATSxx
CREATE TABLE track_e_item_property(id int NOT NULL auto_increment PRIMARY KEY, course_id int NOT NULL, item_property_id int NOT NULL, title varchar(255), content text, progress int NOT NULL default 0, lastedit_date datetime NOT NULL default '0000-00-00 00:00:00', lastedit_user_id int NOT NULL, session_id int NOT NULL default 0);
ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id);

Loading…
Cancel
Save