diff --git a/main/install/db_main.sql b/main/install/db_main.sql index bb4419709d..c87a8b5dac 100644 --- a/main/install/db_main.sql +++ b/main/install/db_main.sql @@ -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.10483','DokeosDatabaseVersion','',NULL,NULL,0); +('dokeos_database_version', NULL, 'textfield', NULL,'1.8.7.10610','DokeosDatabaseVersion','',NULL,NULL,0); UNLOCK TABLES; diff --git a/main/install/db_stats.sql b/main/install/db_stats.sql index cc49f0a9f0..b8811f998e 100644 --- a/main/install/db_stats.sql +++ b/main/install/db_stats.sql @@ -50,6 +50,7 @@ CREATE TABLE track_e_access ( access_date datetime NOT NULL default '0000-00-00 00:00:00', access_cours_code varchar(40) NOT NULL default '', access_tool varchar(30) default NULL, + access_session_id int NOT NULL default 0, PRIMARY KEY (access_id), KEY access_user_id (access_user_id), KEY access_cours_code (access_cours_code) @@ -86,6 +87,7 @@ CREATE TABLE track_e_downloads ( down_date datetime NOT NULL default '0000-00-00 00:00:00', down_cours_id varchar(40) NOT NULL default '', down_doc_path varchar(255) NOT NULL default '', + down_session_id INT NOT NULL DEFAULT 0, PRIMARY KEY (down_id), KEY down_user_id (down_user_id), KEY down_cours_id (down_cours_id) @@ -157,6 +159,7 @@ CREATE TABLE track_e_links ( links_date datetime NOT NULL default '0000-00-00 00:00:00', links_cours_id varchar(40) NOT NULL default '' , links_link_id int NOT NULL default 0, + links_session_id INT NOT NULL DEFAULT 0, PRIMARY KEY (links_id), KEY links_cours_id (links_cours_id), KEY links_user_id (links_user_id) @@ -178,6 +181,7 @@ CREATE TABLE track_e_online ( login_date datetime NOT NULL default '0000-00-00 00:00:00', login_ip varchar(39) NOT NULL default '', course varchar(40) default NULL, + session_id INT NOT NULL DEFAULT 0, PRIMARY KEY (login_id), KEY login_user_id (login_user_id) ); @@ -197,6 +201,7 @@ CREATE TABLE track_e_uploads ( upload_date datetime NOT NULL default '0000-00-00 00:00:00', upload_cours_id varchar(40) NOT NULL default '', upload_work_id int NOT NULL default 0, + upload_session_id INT NOT NULL DEFAULT 0, PRIMARY KEY (upload_id), KEY upload_user_id (upload_user_id), KEY upload_cours_id (upload_cours_id) @@ -209,6 +214,7 @@ CREATE TABLE track_e_course_access ( login_course_date datetime NOT NULL default '0000-00-00 00:00:00', logout_course_date datetime default NULL, counter int NOT NULL, + session_id int NOT NULL default 0, PRIMARY KEY (course_access_id) ); @@ -244,4 +250,10 @@ ALTER TABLE track_e_course_access ADD INDEX (user_id); ALTER TABLE track_e_course_access ADD INDEX (login_course_date); ALTER TABLE track_e_course_access ADD INDEX (course_code); ALTER TABLE track_e_online ADD INDEX (course); -ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id); \ No newline at end of file +ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id); +ALTER TABLE track_e_access ADD INDEX (access_session_id); +ALTER TABLE track_e_course_access ADD INDEX (session_id); +ALTER TABLE track_e_downloads ADD INDEX (down_session_id); +ALTER TABLE track_e_links ADD INDEX (links_session_id); +ALTER TABLE track_e_uploads ADD INDEX (upload_session_id); +ALTER TABLE track_e_online ADD INDEX (session_id); \ No newline at end of file diff --git a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql index 5244cd5b47..3dea57fe6b 100755 --- a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql +++ b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql @@ -48,11 +48,23 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value, ALTER TABLE user_field_values CHANGE id id BIGINT NOT NULL AUTO_INCREMENT; ALTER TABLE user_field_values ADD INDEX (user_id, field_id); -UPDATE settings_current SET selected_value = '1.8.7.10483' WHERE variable = 'dokeos_database_version'; +UPDATE settings_current SET selected_value = '1.8.7.10610' WHERE variable = 'dokeos_database_version'; -- 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); +ALTER TABLE track_e_access ADD access_session_id INT NOT NULL DEFAULT 0; +ALTER TABLE track_e_access ADD INDEX (access_session_id); +ALTER TABLE track_e_course_access ADD session_id INT NOT NULL DEFAULT 0; +ALTER TABLE track_e_course_access ADD INDEX (session_id); +ALTER TABLE track_e_downloads ADD down_session_id INT NOT NULL DEFAULT 0; +ALTER TABLE track_e_downloads ADD INDEX (down_session_id); +ALTER TABLE track_e_links ADD links_session_id INT NOT NULL DEFAULT 0; +ALTER TABLE track_e_links ADD INDEX (links_session_id); +ALTER TABLE track_e_uploads ADD upload_session_id INT NOT NULL DEFAULT 0; +ALTER TABLE track_e_uploads ADD INDEX (upload_session_id); +ALTER TABLE track_e_online ADD session_id INT NOT NULL DEFAULT 0; +ALTER TABLE track_e_online ADD INDEX (session_id); -- xxUSERxx