added session_id field to some tables for stats database - partial CT#570

skala
Cristian Fasanando 15 years ago
parent 3dd25788c2
commit 5a24416d01
  1. 2
      main/install/db_main.sql
  2. 12
      main/install/db_stats.sql
  3. 14
      main/install/migrate-db-1.8.6.2-1.8.7-pre.sql

@ -754,7 +754,7 @@ VALUES
('show_tabs', 'dashboard', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsDashboard', 1), ('show_tabs', 'dashboard', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsDashboard', 1),
('use_users_timezone', 'timezones', 'radio', 'Timezones', 'true', 'UseUsersTimezoneTitle','UseUsersTimezoneComment',NULL,'Timezones', 1), ('use_users_timezone', 'timezones', 'radio', 'Timezones', 'true', 'UseUsersTimezoneTitle','UseUsersTimezoneComment',NULL,'Timezones', 1),
('timezone_value', 'timezones', 'select', 'Timezones', '', 'TimezoneValueTitle','TimezoneValueComment',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; UNLOCK TABLES;

@ -50,6 +50,7 @@ CREATE TABLE track_e_access (
access_date datetime NOT NULL default '0000-00-00 00:00:00', access_date datetime NOT NULL default '0000-00-00 00:00:00',
access_cours_code varchar(40) NOT NULL default '', access_cours_code varchar(40) NOT NULL default '',
access_tool varchar(30) default NULL, access_tool varchar(30) default NULL,
access_session_id int NOT NULL default 0,
PRIMARY KEY (access_id), PRIMARY KEY (access_id),
KEY access_user_id (access_user_id), KEY access_user_id (access_user_id),
KEY access_cours_code (access_cours_code) 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_date datetime NOT NULL default '0000-00-00 00:00:00',
down_cours_id varchar(40) NOT NULL default '', down_cours_id varchar(40) NOT NULL default '',
down_doc_path varchar(255) NOT NULL default '', down_doc_path varchar(255) NOT NULL default '',
down_session_id INT NOT NULL DEFAULT 0,
PRIMARY KEY (down_id), PRIMARY KEY (down_id),
KEY down_user_id (down_user_id), KEY down_user_id (down_user_id),
KEY down_cours_id (down_cours_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_date datetime NOT NULL default '0000-00-00 00:00:00',
links_cours_id varchar(40) NOT NULL default '' , links_cours_id varchar(40) NOT NULL default '' ,
links_link_id int NOT NULL default 0, links_link_id int NOT NULL default 0,
links_session_id INT NOT NULL DEFAULT 0,
PRIMARY KEY (links_id), PRIMARY KEY (links_id),
KEY links_cours_id (links_cours_id), KEY links_cours_id (links_cours_id),
KEY links_user_id (links_user_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_date datetime NOT NULL default '0000-00-00 00:00:00',
login_ip varchar(39) NOT NULL default '', login_ip varchar(39) NOT NULL default '',
course varchar(40) default NULL, course varchar(40) default NULL,
session_id INT NOT NULL DEFAULT 0,
PRIMARY KEY (login_id), PRIMARY KEY (login_id),
KEY login_user_id (login_user_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_date datetime NOT NULL default '0000-00-00 00:00:00',
upload_cours_id varchar(40) NOT NULL default '', upload_cours_id varchar(40) NOT NULL default '',
upload_work_id int NOT NULL default 0, upload_work_id int NOT NULL default 0,
upload_session_id INT NOT NULL DEFAULT 0,
PRIMARY KEY (upload_id), PRIMARY KEY (upload_id),
KEY upload_user_id (upload_user_id), KEY upload_user_id (upload_user_id),
KEY upload_cours_id (upload_cours_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', login_course_date datetime NOT NULL default '0000-00-00 00:00:00',
logout_course_date datetime default NULL, logout_course_date datetime default NULL,
counter int NOT NULL, counter int NOT NULL,
session_id int NOT NULL default 0,
PRIMARY KEY (course_access_id) PRIMARY KEY (course_access_id)
); );
@ -245,3 +251,9 @@ 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_course_access ADD INDEX (course_code);
ALTER TABLE track_e_online ADD INDEX (course); ALTER TABLE track_e_online ADD INDEX (course);
ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id); 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);

@ -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 CHANGE id id BIGINT NOT NULL AUTO_INCREMENT;
ALTER TABLE user_field_values ADD INDEX (user_id, field_id); 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 -- 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); 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_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 -- xxUSERxx

Loading…
Cancel
Save