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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. CREATE TABLE `templates` (
  24. `id` int(11) NOT NULL auto_increment,
  25. `title` varchar(100) NOT NULL,
  26. `description` varchar(250) NOT NULL,
  27. `course_code` varchar(40) NOT NULL,
  28. `user_id` int(11) NOT NULL,
  29. `ref_doc` int(11) NOT NULL,
  30. PRIMARY KEY (`id`)
  31. );
  32. -- xxSTATSxx
  33. ALTER TABLE `track_e_downloads` ADD INDEX ( `down_user_id` );
  34. ALTER TABLE `track_e_downloads` ADD INDEX ( `down_cours_id` );
  35. ALTER TABLE `track_e_exercices` ADD INDEX ( `exe_cours_id` );
  36. ALTER TABLE `track_e_hotpotatoes` ADD INDEX ( `exe_user_id` );
  37. ALTER TABLE `track_e_hotpotatoes` ADD INDEX ( `exe_cours_id` );
  38. ALTER TABLE `track_e_lastaccess` ADD INDEX ( `access_session_id` );
  39. ALTER TABLE `track_e_links` ADD INDEX ( `links_cours_id` );
  40. ALTER TABLE `track_e_links` ADD INDEX ( `links_user_id` );
  41. ALTER TABLE `track_e_uploads` ADD INDEX ( `upload_user_id` );
  42. ALTER TABLE `track_e_uploads` ADD INDEX ( `upload_cours_id` );
  43. -- xxUSERxx
  44. -- xxCOURSExx
  45. 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');
  46. ALTER TABLE lp_iv_objective ADD INDEX (lp_iv_id);
  47. ALTER TABLE lp_item CHANGE prerequisite prerequisite TEXT DEFAULT NULL;