migrate-db-1.8.4-1.8.5-pre.sql 13 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. -- This script updates the databases structure before migrating the data from
  2. -- version 1.8.4 to version 1.8.5
  3. -- it is intended as a standalone script, however, because of the multiple
  4. -- databases related difficulties, it should be parsed by a PHP script in
  5. -- order to connect to and update the right databases.
  6. -- There is one line per query, allowing the PHP function file() to read
  7. -- all lines separately into an array. The xxMAINxx-type markers are there
  8. -- to tell the PHP script which database we're talking about.
  9. -- By always using the keyword "TABLE" in the queries, we should be able
  10. -- to retrieve and modify the table name from the PHP script if needed, which
  11. -- will allow us to deal with the unique-database-type installations
  12. --
  13. -- This first part is for the main database
  14. -- xxMAINxx
  15. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registration', 'mycomptetences', 'checkbox', 'User', 'false', 'ExtendedProfileRegistrationTitle', 'ExtendedProfileRegistrationComment', NULL, 'MyCompetences');
  16. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registration', 'mydiplomas', 'checkbox', 'User', 'false', 'ExtendedProfileRegistrationTitle', 'ExtendedProfileRegistrationComment', NULL, 'MyDiplomas');
  17. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registration', 'myteach', 'checkbox', 'User', 'false', 'ExtendedProfileRegistrationTitle', 'ExtendedProfileRegistrationComment', NULL, 'MyTeach');
  18. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registration', 'mypersonalopenarea', 'checkbox', 'false', 'true', 'ExtendedProfileRegistrationTitle', 'ExtendedProfileRegistrationComment', NULL, 'MyPersonalOpenArea');
  19. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registrationrequired', 'mycomptetences', 'checkbox', 'false', 'true', 'ExtendedProfileRegistrationRequiredTitle', 'ExtendedProfileRegistrationRequiredComment', NULL, 'MyCompetences');
  20. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registrationrequired', 'mydiplomas', 'checkbox', 'false', 'true', 'ExtendedProfileRegistrationRequiredTitle', ExtendedProfileRegistrationRequiredComment', NULL, 'MyDiplomas');
  21. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registrationrequired', 'myteach', 'checkbox', 'false', 'true', 'ExtendedProfileRegistrationRequiredTitle', ExtendedProfileRegistrationRequiredComment', NULL, 'MyTeach');
  22. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('extendedprofile_registrationrequired', 'mypersonalopenarea', 'checkbox', 'User', 'false', 'ExtendedProfileRegistrationRequiredTitle', ExtendedProfileRegistrationRequiredComment', NULL, 'MyPersonalOpenArea');
  23. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('noreply_email_address', '', 'textfield', 'Platform', '', 'NoReplyEmailAddress', 'NoReplyEmailAddressComment', NULL, NULL);
  24. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('survey_email_sender_noreply', '', 'radio', 'Course', 'coach', 'SurveyEmailSenderNoReply', 'SurveyEmailSenderNoReplyComment', NULL, NULL);
  25. INSERT INTO settings_options (variable, value, display_text) VALUES ('survey_email_sender_noreply', 'coach', 'CourseCoachEmailSender');
  26. INSERT INTO settings_options (variable, value, display_text) VALUES ('survey_email_sender_noreply', 'noreply', 'NoReplyEmailSender');
  27. DELETE FROM settings_current WHERE variable='show_student_view';
  28. DELETE FROM settings_options WHERE variable='show_student_view';
  29. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('openid_authentication', NULL, 'radio', 'Security', 'false', 'OpenIdAuthentication', 'OpenIdAuthenticationComment', NULL, NULL);
  30. INSERT INTO settings_options (variable, value, display_text) VALUES ('openid_authentication', 'true', 'Yes');
  31. INSERT INTO settings_options (variable, value, display_text) VALUES ('openid_authentication', 'false', 'No');
  32. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('profile','openid','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'OpenIDURL');
  33. CREATE TABLE templates (id int NOT NULL auto_increment, title varchar(100) NOT NULL, description varchar(250) NOT NULL, course_code varchar(40) NOT NULL, user_id int NOT NULL, ref_doc int NOT NULL, PRIMARY KEY (id));
  34. ALTER TABLE user ADD openid varchar(255) DEFAULT NULL;
  35. ALTER TABLE user ADD INDEX (openid(50));
  36. CREATE TABLE IF NOT EXISTS openid_association (id int NOT NULL auto_increment,idp_endpoint_uri text NOT NULL,session_type varchar(30) NOT NULL,assoc_handle text NOT NULL,assoc_type text NOT NULL,expires_in bigint NOT NULL,mac_key text NOT NULL,created bigint NOT NULL,PRIMARY KEY (id));
  37. CREATE TABLE gradebook_category ( id int NOT NULL auto_increment, name text NOT NULL, description text, user_id int NOT NULL, course_code varchar(40) default NULL, parent_id int default NULL, weight smallint NOT NULL, visible tinyint NOT NULL, certif_min_score int DEFAULT NULL, PRIMARY KEY (id));
  38. CREATE TABLE gradebook_evaluation ( id int unsigned NOT NULL auto_increment, name text NOT NULL, description text, user_id int NOT NULL, course_code varchar(40) default NULL, category_id int default NULL, date int default 0, weight smallint NOT NULL, max float unsigned NOT NULL, visible tinyint NOT NULL, PRIMARY KEY (id));
  39. CREATE TABLE gradebook_link ( id int NOT NULL auto_increment, type int NOT NULL, ref_id int NOT NULL, user_id int NOT NULL, course_code varchar(40) NOT NULL, category_id int NOT NULL, date int default NULL, weight smallint NOT NULL, visible tinyint NOT NULL, PRIMARY KEY (id));
  40. CREATE TABLE gradebook_result ( id int NOT NULL auto_increment, user_id int NOT NULL, evaluation_id int NOT NULL, date int NOT NULL, score float unsigned default NULL, PRIMARY KEY (id));
  41. CREATE TABLE gradebook_score_display ( id int NOT NULL auto_increment, score float unsigned NOT NULL, display varchar(40) NOT NULL, PRIMARY KEY (id));
  42. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('gradebook_enable', NULL, 'radio', 'Gradebook', 'false', 'GradebookActivation', 'GradebookActivationComment', NULL, NULL);
  43. INSERT INTO settings_options (variable, value, display_text) VALUES ('gradebook_enable', 'true', 'Yes');
  44. INSERT INTO settings_options (variable, value, display_text) VALUES ('gradebook_enable', 'false', 'No');
  45. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('show_tabs','my_gradebook','checkbox','Platform','true','ShowTabsTitle','ShowTabsComment',NULL,'TabsMyGradebook');
  46. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('gradebook_score_display_coloring', 'my_display_coloring', 'checkbox', 'Gradebook', 'false', 'GradebookScoreDisplayColoring', 'GradebookScoreDisplayColoringComment', NULL, 'TabsGradebookEnableColoring');
  47. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('gradebook_score_display_custom', 'my_display_custom', 'checkbox', 'Gradebook', 'false', 'GradebookScoreDisplayCustom', 'GradebookScoreDisplayCustomComment', NULL, 'TabsGradebookEnableCustom');
  48. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('gradebook_score_display_colorsplit', NULL, 'textfield', 'Gradebook', '50', 'GradebookScoreDisplayColorSplit', 'GradebookScoreDisplayColorSplitComment', NULL, NULL);
  49. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('gradebook_score_display_upperlimit', 'my_display_upperlimit', 'checkbox', 'Gradebook', 'false', 'GradebookScoreDisplayUpperLimit', 'GradebookScoreDisplayUpperLimitComment', NULL, 'TabsGradebookEnableUpperLimit');
  50. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('service_ppt2lp', 'port', 'checkbox', NULL, '2002', 'Port', NULL, NULL, NULL);
  51. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('user_selected_theme',NULL,'radio','Platform','false','UserThemeSelection','UserThemeSelectionComment',NULL,NULL);
  52. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('profile','theme','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'UserTheme');
  53. INSERT INTO settings_options (variable, value, display_text) VALUES ('user_selected_theme', 'true', 'Yes');
  54. INSERT INTO settings_options (variable, value, display_text) VALUES ('user_selected_theme', 'false', 'No');
  55. ALTER TABLE user ADD theme varchar(255) DEFAULT NULL;
  56. ALTER TABLE user ADD drh_hr_dept_id smallint unsigned NOT NULL default 0;
  57. UPDATE settings_current SET variable='service_visio', subkey='active' , title='VisioEnable' WHERE variable='service_visio' AND subkey='active';
  58. UPDATE settings_current SET variable='service_visio', subkey='visio_host', title='VisioHost' WHERE variable='service_visio' AND subkey='visio_rtmp_host_local';
  59. UPDATE settings_current SET variable='service_visio', subkey='visio_port', title='VisioPort' WHERE variable='service_visio' AND subkey='visio_rtmp_port';
  60. UPDATE settings_current SET variable='service_visio', subkey='visio_pass', title='VisioPassword', type='textfield' WHERE variable='service_visio' AND subkey='visio_rtmp_tunnel_port';
  61. DELETE FROM settings_options WHERE variable = 'visio_rtmp_host_local';
  62. DELETE FROM settings_current WHERE variable='service_visio' AND subkey='visioconference_url';
  63. DELETE FROM settings_current WHERE variable='service_visio' AND subkey='visioclassroom_url';
  64. DELETE FROM settings_current WHERE variable='service_visio' AND subkey='visio_is_web_rtmp';
  65. INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('allow_course_theme',NULL,'radio','Course','true','AllowCourseThemeTitle','AllowCourseThemeComment',NULL,NULL);
  66. INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_course_theme', 'true', 'Yes');
  67. INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_course_theme', 'false', 'No');
  68. -- xxSTATSxx
  69. ALTER TABLE track_e_downloads ADD INDEX (down_user_id);
  70. ALTER TABLE track_e_downloads ADD INDEX (down_cours_id);
  71. ALTER TABLE track_e_exercices ADD INDEX (exe_cours_id);
  72. ALTER TABLE track_e_hotpotatoes ADD INDEX (exe_user_id);
  73. ALTER TABLE track_e_hotpotatoes ADD INDEX (exe_cours_id);
  74. ALTER TABLE track_e_lastaccess ADD INDEX (access_session_id);
  75. ALTER TABLE track_e_links ADD INDEX (links_cours_id);
  76. ALTER TABLE track_e_links ADD INDEX (links_user_id);
  77. ALTER TABLE track_e_uploads ADD INDEX (upload_user_id);
  78. ALTER TABLE track_e_uploads ADD INDEX (upload_cours_id);
  79. ALTER TABLE track_e_attempt ADD tms datetime not null default '0000-00-00 00:00:00';
  80. -- xxUSERxx
  81. -- xxCOURSExx
  82. CREATE TABLE lp_iv_objective(id bigint unsigned primary key auto_increment, lp_iv_id bigint unsigned not null, order_id smallint unsigned not null default 0, objective_id varchar(255) not null default '', score_raw float unsigned not null default 0, score_max float unsigned not null default 0, score_min float unsigned not null default 0, status char(32) not null default 'not attempted');
  83. ALTER TABLE lp_iv_objective ADD INDEX (lp_iv_id);
  84. ALTER TABLE lp_item CHANGE prerequisite prerequisite TEXT DEFAULT NULL;
  85. INSERT INTO course_setting(variable,value,category) VALUES ('email_alert_manager_on_new_quiz',0,'quiz');
  86. ALTER TABLE dropbox_post ADD session_id SMALLINT UNSIGNED NOT NULL ;
  87. ALTER TABLE dropbox_post ADD INDEX ( session_id ) ;
  88. ALTER TABLE dropbox_file ADD session_id SMALLINT UNSIGNED NOT NULL ;
  89. ALTER TABLE dropbox_file ADD INDEX ( session_id ) ;
  90. ALTER TABLE item_property ADD INDEX (tool,ref);
  91. ALTER TABLE forum_forum ADD session_id SMALLINT UNSIGNED DEFAULT 0 ;
  92. INSERT INTO course_setting(variable,value,category) VALUES ('allow_user_image_forum',1,'forum');
  93. INSERT INTO course_setting(variable,value,category) VALUES ('course_theme','','theme');